Posted by: Hurtful Goat | November 7, 2009

I have achieved victory!

Ok, I really like wallpapers. I have ~300 now. That’s too many to select manually. So I use OS X wallpaper shuffling function. It picks one at random at the time you set, I chose 5 mins. Great. Except…I gave up a dedicated wallpapers folder awhile ago. It was getting much to large to be useful. After much rearranging, I sorted my ENTIRE pictures folder solely by the content of the images. Great for finding things. Not so great for keeping the 400×900 images away from the wallpaper shuffler.

So, now what? One idea was an album in iPhoto. This has the little problem of having to add every damn wallpaper to iPhoto. I actually tried this method once, but it proved way too much work. This had to be done directly in the filesystem. Tonight, I had a great idea! Spotlight, the built in search! It can save a canned search as a smart folder. The difference between a regular folder and a smart folder is kind of like the difference between a regular playlist and a smart playlist in iTunes. A regular playlist contains items you dragged in there, a smart playlist contains things that match a criteria. So I wanted it to look for wallpapers.

Ok, that was easy. But, problem. The wallpaper selector evidently will not take a smart folder as a valid wallpaper storage directory! Oops! Ok, now what. Well, will it take an alias? A quick test showed it does! So I made a dedicated wallpapers folder, which contains only aliases. It also contains the smart folder, which makes getting those aliases easy. Anything tagged as a wallpaper shows up in the smart folder, which can be sorted by Date Modified so new wallpapers are easy to find. So while there appears to be a dedicated wallpapers folder, it contains only pointers to the real images in their proper locations, sorted by content. The wallpapers pref pane never knows the difference! w00t!

Ok, you are now thinking, “dude, this whole system relies on the image being tagged as a wallpaper somehow! What if the word ‘wallpaper’ was never added to the image metadata before it was put up for download? Are you gonna put that stuff in one by one??” Nope. :) This is where OS X starts getting REALLY awesome. Each file has a field attached to it, labeled “Spotlight Comments”. Anything you type here is indexed with the file by the metadata server, which Spotlight uses for its lookups. If you add the word “wallpaper” to this field, a search for “wallpaper” returns the image, even if there was nothing in the normal metadata about wallpapers.

But doing “Get Info” and adding that word for hundreds of images? fuckno. Still a lot of work. But computers were built so we wouldn’t have to do the same crap over and over and over. To the rescue comes Snow Leopard’s contextual services menu, and the OS X Automator program, which can take a series of actions and make them into a service. There is a built in action for “Append to spotlight comments”. I simply set this one up with the text ” wallpaper” (the space was in case there was stuff already there, and saved it. So….select all the files you want to tag and Finder > Services > Tag as Wallpaper. Done.

If you want that Service for your Mac, you can download it here. Unzip it and copy it to your ~/Library/Services folder. I am 95% sure you will need to be running Snow Leopard for it to work.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.