Friday, April 6, 2007

Rotating desktop pictures from an iPhoto smart album

When I was little we'd often go on long roadtrips. I remember being surprised that my dad was constantly fascinated by the scenery, especially the scenery he saw the last time we drove down that road! Still, as long as the view changed noticeably between times when I'd look up out the window, I felt like we were making progress.

Same deal for my desktop picture. As long as it changes periodically, I feel like I'm getting somewhere. If it's set to random, my brain somehow thinks that someone smarter than me is driving this car, and we'll be at a better place soon.* "How much longer?" "5 more minutes."

But tonight, I noticed that if I select an iPhoto album, it grays out the "Change picture" option, meaning that I have to drive the car! Why can't it drive? What could be so hard about that?

Well, here's an option for people who really want to do it and who aren't afraid of copy/pasting regular expressions and into the Terminal:
  1. Make a new folder called "Desktop Pictures" (or whatever) in your /Pictures folder
  2. Open a new plain text document in BBEdit ($$) or TextWrangler (free, both available from http://www.barebones.com)
  3. Open iPhoto, then select all the pictures in the album you want and cmd-drag them to the new BBEdit or TextWrangler document -- this should insert the path to each of the pictures on its own line
  4. In that text document, replace "(.+)" with "ln -s '\1' ." (without the double quotes, make sure "Use Grep" is checked on)
  5. Open up the terminal, enter this and hit return: cd ~/Pictures/Desktop\ Pictures
  6. Then select all the lines from the text document and drag them into the Terminal window
  7. Switch back to the Desktop system preference, pick "Choose folder", and select the /Pictures/Desktop\ Pictures folder
Now you should be able to on-click the "Change picture" setting. It won't auto-update if you change the contents of the album, but this is pretty close to what we wanted. =)



* Not really, but a little. Ask me about sleeping on an elevated bed sometime.

No comments:

Does anyone read this thing?

views since Feb. 9, 2008