MarsEdit is a handy Macintosh application that I use to compose entries for my website. Unfortunately, for reasons I don’t understand, when I publish a post with MarsEdit, none of Movable Type’s plug-ins seem to fire off. At present I use Multiblog to rebuilt my Debigulated URLs blog, which allows short URLs to work for all of my main blog’s entries, and I use MT-PubSubHubbub to ping Google’s PubSubHubbub hub when I post a new entry. If Multiblog doesn’t get triggered, the short URL I’m declaring in my page’s head
won’t work because the .htaccess
file at my link shortener hasn’t been rebuilt. If MT-PubSubHubbub doesn’t fire, the hub won’t get notified of a new post. I can work around the first problem using Bob the Rebuilder, and I’ve written up a sloppy AppleScript to deal with pinging the hub from MarsEdit.
I am absolutely certain that there’s a better way to do this, but here’s what I’ve got going for now. It works in testing using FriendFeed, which updates within seconds of a post that pings Google’s hub1. Here’s the script:
tell application "Safari" activate do JavaScript "window.open('http://david. ely.fm/davextreme/')" in document 1 end tell delay 2 tell application "System Events" tell process "Safari" tell menu bar 1 tell menu bar item "Bookmarks" tell menu "Bookmarks" tell menu item "Bookmarklets" tell menu "Bookmarklets" click menu item "Publish to Hub" end tell end tell end tell end tell end tell end tell end tell delay 2 tell application "Safari" to close the front window
I placed the script in my MarsEdit scripts folder (found easily by going to MarsEdit’s Scripts menu and selecting “Open Scripts Folder”).
The script requires that you have:
- A “Bookmarklets” folder in your main Bookmarks menu in Safari; and
- Google’s “Publish to Hub” bookmarklet in that folder, which bookmarklet can be found on Google’s site near the bottom of the page2.
From there, I post an entry using MarsEdit, then select my “Ping Hub” script from the Scripts menu. It opens my webpage, waits two seconds for it to load, invokes the “Publish to Hub” bookmarklet, then closes the window.
My hope is that someone develops a plugin for MarsEdit that does this more elegantly, but maybe this will be helpful to people in the meantime. (Or someone can tell me why those plugins don’t activate when my xmlrpc
updates go through.)