Keyboard Maestro Macro: Publishing to WordPress from iA Writer (kind of)

One of the things I used to love about doing all of my writing in TextMate was publishing directly to this site using the “blogging” bundle. iA Writer is a better writing app than TextMate, so the tradeoff when I switched seemed fair, but I still get annoyed every time I copy and paste the latest post into MarsEdit.

This is further complicated by linked-list style posting: When I did Daring Fireball style linked lists, with one-line comments, it was easy to quickly post a link with a pull-quote by hitting CMD+1. That shortcut dumped all the data I grabbed into MarsEdit. But it sucks for my Kottke-style links where I try to write a bit more — often not in the same sitting.

Bottom line: My most irritating workflow problem used to be the amount of copying and pasting going on just to post something to this site.

That’s now changed.

The Research

The biggest stumbling block was getting the text to WordPress from Writer. I found ways to do it via PHP, Python, and a command line interface — but none of these were solutions that I could figure out, or wanted use. Additionally these solutions require detailed documentation to reinstall, should I start on a fresh computer.1

I wanted something easier. Actually I wanted an AppleScript that would send the post, but I’ve yet to figure that out.

MarsEdit was out of the running due to it having categories under check boxes that I can’t easily set using the keyboard.

Welcome back TextMate, old friend.

The Macro

The macro.

You can see the macro on the side there. It’s not overly complicated, just lots of actions.

Here’s what the macro does (simplified):

  1. Grabs the title, which it places at the top of the post, prefixed with a # and followed by a carriage return.
  2. Grabs the body text.
  3. Asks me for metadata.
  4. Opens a new TextMate document and dumps all that information in, formatted for the TextMate blogging bundle.
  5. Waits for me to publish the post (so I can check everything looks correct).
  6. When I hit the shortcut to publish in TextMate, the post publishes. The changes to the Writer file are reverted and saved, then the windows for all the programs used are closed.

Pretty simple.

Another thing I wanted was to set the scheduled publish date, which meant adding a field in TextMate containing a correctly formatted date string. I used a TextExpander snippet to speed things up (;bdate).

(Here’s the detail view of some of the actions that you may find useful. Pause action. Meta data questionnaire. Text insertion to TextMate.)

End Result

Now I can publish from iA Writer via a series of simple actions, triggered by a single keystroke.

Because I install this macro’s only dependencies — Writer and TextMate — on every Mac I own, the solution is simple to reinstall and portable.

You can download the macro here.


  1. This is something I have recently done, so I’m a bit sensitive to it. 

Become a Member

This site is 100% member supported and free of advertising. Members receive access to exclusive weekly content: iPad Productivity Report, videos, and the best products listing.

Join Now

Already a member? Please sign in.

Article Details

Published
by Ben Brooks
3 minutes to read.


tl;dr

One of the things I used to love about doing all of my writing in TextMate was publishing directly to this site using the “blogging” bundle. iA Writer is a better writing app than TextMate, so the tradeoff when I switched seemed fair, but I still get annoyed every time I copy and paste the […]