Automator workflow of the month: Automatically copy Photo Stream images
I recently read Jeff Carlson’s “Four things Apple could do to improve iPhoto right now,” and one point he made struck me in particular—that I couldn't make Photo Stream images appear in a folder of my choosing. Thinking how convenient this could be—for copying images into my Dropbox folder, for example—I set about finding a way.
The slow and clumsy way
A simple-but-clumsy way to do this is to access the folder where the images are stored on your Mac and then open a load of folders inside that folder to get to your images. You can navigate to this folder by choosing Go > Go to Folder in the Finder, entering
~/Library/Application Support/iLifeAssetManagement/assets/sub in the Go to the folder field, and clicking Go. This exposes a window full of folders, each folder containing an image.
As I said, clumsy. And lacking the kind of automation that would make the process really sing. So naturally I turned to Automator. And came up with this.
The Automator way
Launch Automator (in your /Applications folder) and from the workflow template chooser select Folder Action and click Choose. Into the very top pop-up menu that follows ‘Folder Action receives files and folders added to’, drag the folder named ‘sub’ that we just visited.
Choose the Files & Folders library in the left-most pane, and from it drag these actions into the workflow area in order: Get Specified Finder Items, Get Folder Contents, Filter Finder Items, and Copy Finder Items.
Drag the ‘sub’ folder into the first action (Get Specified Finder Items). In the Get Folder Contents action, enable the Repeat for each subfolder found option. Configure the third action (Filter Finder Items) to read:
All of the following are true Kind is not folder
Finally, in the Finder, create a folder where you’d like to copy your Photo Stream images, and drag that folder into the pop-up menu in the fourth action (Copy Finder Items). You might, for example, create this folder within your Dropbox folder so that your Photo Stream images because available via Dropbox. Then enable the Replacing existing files option.
Hang on—we’re not done yet. Now click the Run button at the top of the workflow. When you do this, any images within the ‘sub’ folder will be copied to the folder you’ve created.
Return to your workflow, and in the Filter Finder Items action click the plus (+) button to create another condition. Configure that condition to read Date created is today. Now save and name your workflow.
The magic behind the workflow
So what exactly has gone on here? Here’s what you asked Automator to do:
Go to the ‘sub’ folder and get its contents—digging down through any folders it contains. Grab everything in this folder (and its folders) that isn’t a folder and copy those items to this other folder I’ve created.
After you click the Run button to create those copies and you add the condition to the Filter Finder Items action, here's what Automator is charged to do:
Now that you’ve made those copies, any time a new image is placed in the ‘sub’ folder (as it will be when a Photo Stream image appears) automatically copy it to the destination configured in the Copy Finder Items action. To ensure that multiple copies of images don’t appear in this folder, overwrite any previous iterations.
This technique may elicit a “yeesh” from squeamish readers, but it’s actually quite easy to put together. And safe. You’re not interfering with the original images. Instead, you’re simply making copies. Problem solved.