About a year ago, when Tiger was in Public Beta, Thies told me to check out Automator. I didn’t get around to it because Thies is in the habit of saying things like, “Skype is God’s Own phone.” When everything is “God’s Own” X, then saying something like, “Automator is cool” isn’t going to get me jumping onto BitTorrent, especially since I never grokked AppleScript.
Earlier this year, I gave a talk in Vancouver. After Cal, the lead developer of Flickr, complimented me on it, I decided to see his talk. Okay, so his doesn’t have cool Keynote transitions like mine, but in terms of content, it totally rocks. What he and Ludicorp were able to do building Flickr is textbook case of why LAMP rules in the right hands. Go see his talk! I was impressed.
I registered for Flickr.
There was one major wart I’ve run into. Flickr loses color space information on resize. It took me a couple days to figure out on my own why my photos (16-bit ProPhoto colorspace) were getting desaturated.1 Also, for the geek in me, there is no support for JPEG 2000).
I also can’t wait until they integrate purchasing prints into Flickr.
While test-driving some of the community aspects of Flickr, I ran across this post which had a clever idea: Design a photo book in iPhoto and upload it to Flickr. He used this to create a flickr album of his daughter’s life so far. The problem was the process sounded time consuming and required Adobe CS2.2
Since Preview supports PDF export, I got a stupid idea of using Automator to fix these problems. Besides, it was an excuse to see what Thies was raving about last year.
In geek-speak, Automator is “Unix pipes for Applescript”, except instead of chaining applications together using the command line, you chain pre-built “Actions” together in Automator to create “Workflows” via a drag-and-drop interface. Starting from this workflow, it took only 30 minutes3 to write a program to take a PDF, turn it into JPEGs snapshots of each page and upload them to Flickr. That included the download and install of Frasier Speirs’s Flickr Automator Action.
You can download the application here (but you will need the Flickr Automator Action mentioned above). Simply drag-and-drop a PDF into the Application and then you will be given three prompts. The first allows you to set the resolution and compression of the JPEG conversion; the second allows you to name the upload files (edit the “new name” text field); the third allows you to set your flickr login credentials, tags, and security level of the uploaded files). If you want, you can drag-and-drop this application into Automator, edit it, and then save it (as a Workflow) into ~/Library/Workflows/Applications/Finder/. Then you can right click and PDF to upload it to Flickr. Neat!
Is it “God’s Own AppleScript?” Not really. There are some issues I ran into already, besides the crappy debugging capabilities:
- The workflow has trouble distinguishing type information when chaining workflows (it gives a visual error when binding “Files/Folders” to “Image files”).
- The “Move Finder Items” action cannot find your “Desktop” or “Documents” if you turned on FileVault in your Security Preference Pane
- Since you can only pass one type of thing from one workflow to another, there is no way I can clean up the temp files created. (The Flickr action returns URLs of the pages it generates), nor is there a way to automatically get the name of the PDF file to assist in automatically renaming the temp images.
- It’s still not well documented.
However, I find that Automator will be very useful in the future. Since you can bind shell scripts and AppleScripts as Actions, I’ll definitely be having a closer look at it as time goes on.
I asked Caitlin to whip together a iPhoto book so that I could test to see whether my idea actually works. She took some old, un-retouched photos I have from the Point Reyes hike that destroyed my Olympus and whipped together this 6 page album (click to play):