ecto
desktop blogging
endo
total aggregation
1001
flickr accessory

The x-blogpost: URL scheme

Mon, 2008-03-31

The x-blogpost: URL scheme

Starting with ecto version 3b41 you can refer to drafts with an URL scheme, which looks like, for example:

x-blogpost://6449f44a102fde848669bdd9eb6b76fa@ff4d5bd026cb03f18a557ba2b651722b

The URL has two components separated by an '@' sign. The first one is the MD5 of the draft's identifier and the second is the MD5 of the account this draft belongs to. You can use either 'x-blogpost:' or 'x-blogpost://', although the latter works better with Safari.

To create a URL reference to a draft, the easiest way is to drag and drop an item from the main window's list of drafts into an editing area. This works in TextEdit as well, for example. Clicking a x-blogpost: URL will open the corresponding draft in ecto.

UPDATE: After discussion with ecto users and Daniel Jalkut from Red Sweater, the plan is to use x-blogpost: (instead of my original draft:) to avoid possible collisions and to allow for use by other blog clients as an unofficial standard.

You can get the URL via AppleScript as well. Example:

tell application "ecto"
  set account_list to accounts whose name is "foo.com"
  set a to first item of account_list
  properties of a
  set blogs_list to blogs of a
  set b to first item of blogs_list
  properties of b
  tell b
    set entry_list to entries of b
    set e to first item of entry_list
    tell e
      get href
    end tell
  end tell
end tell