From Device to Desktop - Workflows for Saving iOS Screenshots
Today IFTTT released their new iPhone app. It's a well designed app with a few 1.0 issues (who doesn't have those?) but the workflow that had me the most excited was the ability to automatically upload screenshots to a folder in my Dropbox. Naturally, there's a bug in the app (or service) that for some reason converts those PNG files to JPGs before being sent to Dropbox. This introduces artifacts and makes the resulting images pretty much worthless. As anyone in my position would do I immediately took my issue to Twitter.
Update: the IFTTT app has since been updated their app and fixed the issue with screenshots. You can download the updated IFTTT app from the App Store.
Having vented my frustration in the most productive way possible (a passive aggressive tweet), Someone (thanks Zac) sent me a link to an article on theiconmaster.com that, ironically, I had already saved to my Pinboard a few months ago and then immediately forgotten about.
The article details how to add a saved search to your Finder sidebar (and/or Dock) that looks for PNG files in the folder that Photostream uses to temporarily store your images. This gives you quick access to your screenshots (and any other PNGs you might save to your Camera Roll, but hopefully mostly screenshots) without having to fuss with iPhoto.
This is a great solution, but when I realized that Photostream is files on disk and not some kind of Cupertino black magic, it dawned on me that I could get them into Dropbox using a similar strategy to how I backup my Web Receipts folder.
Enter Hazel
I love Hazel. It's one of the first things I install on new machines. It's so good I actually feel relieved when I get to pay for an upgrade. It's also dead simple to set up a couple rules to recursively crawl that assets folder and copy any PNGs it finds to a folder on my dropbox.
The first thing you need to do is go buy Hazel and install it. Done? Good.
Next you need to add the following path as a new Folder in the Hazel preferences pane:
/Users/<USERNAME>/Library/Application Support/iLifeAssetManagement/assets/sub
To that folder we'll add two new rules. The first one will be in charge of copying the PNG files and has only one condition and one action. If the Kind is "Portable Network Graphics" (click "Other" in the drop down menu to find this), then copy the file to, well, whatever folder you want.
We would be able to call it a day here but Photostream organizes the images into subfolders and by default Hazel does not process folders recursively. This is trivial to set up though and requires only one additional rule.
This rule is even more simple than the last. It just says "If you find a folder, apply the rules for the parent folder to it". This rule allows Hazel to move recursively through all the subfolders applying our other rule to the files within them.
And that's it. As long as I have photostream enabled on the device, any screenshot I take will be automatically copied to my Dropbox folder. As a bonus, I even get a clickable notification that will take me right to the file when Hazel does the copy operation.