The other day I read a post by Federico Viticci on moving your photos from iPhoto to Dropbox as a “management app”. I’d pondered this in the past, especially when Dropbox increased everybody’s base storage amount. I’ve never committed and gone through with it though, although I have stopped using iPhoto and replaced it with managing my own folders. When photos are coming in from potentially lots of different devices, I’d rather manage them myself.
Plus, I was never a fan of iPhoto’s “would you like me to delete all these photos now, I’ve copied them all into my library, honestly I have” prompt. I just don’t trust it. I want to see the photos with my own eyes, before I let an app delete them forever.
After Federico’s post, Stephen Hackett posted his own version of the approach, along with an Applescript technique for moving photos from Photostream into Dropbox. But something nagging in the back of my mind said “surely Hazel can do that?” and so I set about to see if it can.
Turns out it’s possible, and I tweeted Stephen to let him know. I thought I’d post this as a more permenant home for the solution because, well, Twitter.
I don’t use Hazel as much as a should. These days I have a Mac Mini running all the time as a server, so it makes sense to start getting Hazel to do more for me. Mail rules are another “thing” I need to get my head around, but that’s an entirely different post!
So, to Photostream and Hazel. The special sauce to make this work is an option in Hazel called “run rules on folder contents”. Photostream creates subfolders on the file system for every photo; instead of…
“\photostream\long guid based id\photo1.jpg”.
You need Hazel to dig down into each folder in the top-level Photostream folder, and treat each folder it finds as a folder to process.
To make this work I added two rules, like this:
Then the first rule is extremely simple:
The second rule is where Stuff Happens. Because the first fule contains “run rules on folder contents”, the second rule happens on each folder within the Photostream directory.
Note: the iPhone Camera Roll folder in the screenshot above is just where all my iPhone photos end up. Just to clarify any “why copy from Photostream back to the camera roll?” confusion.
This isn’t just useful for Photostream, anywhere you want Hazel to process a folder full of folders, you can use this option.
My next trick is working out how best to take two Photostreams and mash them together for archiving.