Automator actions for ecto (Updated)

I updated some actions and added new ones in ecto for MacOSX 2.3.3. Here's what changed:

  • Select Blog: You can now select a specific draft or entry by supplying an id. ecto's AppleScript has been modified to support this. If you want to write AppleScript code that opens a specific draft, use this, for example:
    tell application “ecto”
        set default account to “localhost”
        set default blog to “First Weblog”
        retrieve draft “1”
    end tell
    You need to set the account and blog first, since draft or entry IDs are not unique over blogs. One blog may have a draft with the same id as another blog.
  • Get Contents: A useful action that gives you the text from a specified text field in the frontmost draft window.
  • Set Contents: If the title field is blank, the draft's title will be left untouched. You can now also set the excerpt and keywords fields.
  • Set Date: Added an option to use the date on which the workflow is run.
  • Set Draft Options: Fixed an issue where you couldn't set the format.
  • Upload Images: Improved version. When uploading immediately, the script will wait for the upload to finish and return the URL to the uploaded image.

Here's a screenshot of a sample workflow that uploads a screenshot:

sample Automator workflow

First, we set the account and blog to work in and open a specified draft. We then take the System's “Take Screenshot” action. We set it so that it saves the screenshot to file, because we need a file for ecto's “Upload Images” action. After the image is uploaded, ecto will give us a URL back. This is sent back as text, actually. We take BBEdit's “Search and Replace” action and make the URL text into an IMG tag. The product of the conversion is used to overwrite the original draft's contents. As a final step, the draft is posted (not shown).
UPDATE: It's a better idea to switch the top two actions. In other words, make the screenshot first, before opening a draft, otherwise you'll have it in the screenshot. Since the “Select Blog” action passes on the input, it can be anywhere in the flow.

I found that Automator doesn't always update the action descriptions. I suggest deleting ~/Library/Caches/

Technorati Tags: automator, ecto, Graphical Command Line

Posted by Adriaan on May 16, 2005