Scripting Aperture to MarsEdit to PigPog

Posting photos to PigPog (a WordPress blog) has always been a bit of a pain. I’d made things as smooth as I could, but it was still a bit time-consuming. I was doing this:

  • Take photos.
  • Process photos in Aperture, usually in batches.
  • Export photos to a ‘queue’ folder (sitting in Dropbox – doesn’t need to be, but that way I could do the next steps on a different machine if I wanted to).
  • Repeat for every image…
    • Create a new post in WordPress, through the web interface. Fill in the form. I have to enter a title, description and tags. I usually se these in Aperture already, but if I want to get those now, I have to open Aperture, find the image, then copy/paste those bits in.
    • Add media, dragging the file into the browser window, wait for upload.
    • Schedule the post.
  • I often then juggle posting dates and times around with the Editorial Calandar plugin.
  • Sit back and watch as the posts appear automagically, then also automagically, cross-post themselves to Flickr.

Not too bad, really, and not much harder than posting them to Flickr, but I wanted it to be easier.

After a (somewhat frustrating) morning playing with AppleScript, I now have a setup where I do this:

  • Take photos.
  • Process photos in Aperture, usually in batches. Flag photos that are ready to post.
  • Open MarsEdit, and run my script from its menu.
  • Sit back and watch as posts automagically appear, set up thusly:
    • ‘Photos’ category set.
    • Title set from photo title in Aperture.
    • Description set from photo caption in Aperture.
    • Tags set form keywords in Aperture.
    • Date set to one week’s time, so I have plenty of time to reschedule things.
  • The photos are exported to my queue folder, which opens itself up. I have to drag images into their matching posts where I want them to appear.
  • Save each post, at which point MarsEdit uploads the scheduled post to WordPress, uploading the image attachments.
  • I can then change publishing dates and times to a better schedule.
  • Sit back and watch as the posts appear automagically, then also automagically, cross-post themselves to Flickr.

This list looks pretty long still, but most of the things listed there happen automatically, or are at least being done locally rather than through a web interface. There’s a lot more Sit back and watch to do. I haven’t tried it out for real yet, but I think it’s going to make it faster for me to get photos out there. The less time I have to spend copying titles and descriptions around, and moving files from place to place, the more time there is for taking and processing photos.

The script also sets the colour label for files it’s dealt with, so I know they’ve been posted (or at least exported ready to), which should help me avoid the situation I’ve found myself in a few times, of not knowing if I’ve already posted something, or even posting the same photo twice.