OSX Leopard: How to show the current wallpaper in finder?April 22, 2008 3:35 PMSubscribe

How can I get my iMac running Leopard to show the current wallpaper in Finder? I'm using Leopard's built-in wallpaper-switching function to randomly display a wallpaper from my collection of over 1,000, but when I get one I don't like, it gives me no way to easily find the file and delete it.

For those of you looking to shuffle wallpapers in Windows, I recommend John's Background Switcher.

The on run / end run lines aren't necessary in this context. Simply copy and paste the rest of nowonmai's script into the Script Editor (/Applications/AppleScript/Script Editor) and save it as an Application. Then you can just double-click it when you want to reveal the current desktop image.posted by pmbuko at 6:56 AM on April 23, 2008

Just noticed that you're running Leopard, which gives Applescript better access to this stuff. Here's what you want:

After some testing, I noticed that this method (and those listed above) only seems to return the correct picture the first time it is run. I'll try to figure out the problem.posted by pmbuko at 8:09 AM on April 23, 2008

Ha, yes, these scripts only work once. That's pretty weird.

I think the problem is that the Finder no longer manages the desktop picture in OS X. In Leopard, the System Preferences application is much more scriptable than in 10.4. See http://www.apple.com/applescript/features/system-prefs.html

I can't test it because I don't have Leopard, but the examples on that page imply that a working script should be easy.posted by nowonmai at 3:54 PM on April 23, 2008

Ok... that wasn't quite accurate. It did not, in fact, work the first time either, it was close but as it turns out that was a coincidence. Here's the story:

I tried all scripts but the first, and they all behave the same strange way. Here is what I found: Leopard must maintain a memory of the last manually-selected wallpaper, and then elsewhere must maintain a record of the currently displayed image. I think your scripts are calling for the last manually-selected one, and not the currently-displayed one.

I did a bunch of testing, and I've written and rewritten this description, but that's what I found.

Here's a step-by-step.

I have an iPhoto event called "Wallpapers" that is the list I actually want it to randomly choose from. I have another iPhoto event with pics of my dog. I opened the pets event in the Desktop Preferences window and clicked one, and my dog was displayed as my wallpaper and also as the preview image in the top left corner. I then clicked back to the "Wallpapers" event within the Desktop Preferences, but did NOT click any single photo. The "preview" image in the top left corner was still the pic of my dog. I clicked "Change Picture Every 5 Minutes," and the wallpaper jumped to a wallpaper from the currently selected event, "Wallpapers." The preview pic of my dog was replaced by what I'll call a "cycle" icon.

But then if I turn OFF "Change Picture every 5 minutes..." the wallpaper reverts to the picture of my dog, which is in a different iPhoto event altogether. The preview pic also reverts to my dog, despite the fact that the "Wallpaper" event is selected and not the event with my dog in it. Running any of the scripts also reveals the dog picture.

I turn Change Picture back on, and it displays a normal wallpaper from the "Wallpaper" event. I log off and log back on, the wallpaper is another random wallpaper. I run all three scripts... and they all bring up the dog picture. I turn off "Change Picture" in the Desktop Preferences... and the preview picture and the wallpaper both revert to my dog. Restarting has the same result as logging off and on.

I believe that this icon is only hiding the previously selected image, and that all of these scripts are bringing up the image behind the "cycle" icon, the most recent image to be manually-selected.

Sorry that was so long and complicated but it's tough to explain. Please help! Thanks!posted by XSteveMurphy at 2:30 PM on April 25, 2008

I worked on this problem for a very long time and finally concluded that there is no way to get the current random wallpaper. You can only get the selected wallpaper. I wasn't willing to get rid of random wallpapers so I had to do a workaround. I have a cron job that randomly selects a wallpaper and sets it. That way, the OSX built-in random wallpaper never gets turned on and get desktop picture acts as expected. I have another script that just throws out the current wallpaper. I just call it with quicksilver as needed and it works reliably for me. If you would like copies of the scripts, just MeMail me.posted by MasterShake at 11:38 AM on April 26, 2008

If you have a plist file editor (for example, the one that comes with Developer Tools), open up ~/Library/Preferences/com.apple.desktop.plist. Look at the path /Background/default/NewImageFilePath.

Alas, I am no AppleScript guru, so I don't know how to use that information programmatically.posted by mkb at 4:14 PM on June 28, 2008

@mkb: I don't think I have a plist editor, and don't have Developer Tools, but I did open this file in Text Editor and see where it lists the current wallpaper. So that's a big step in the right direction, we now know where this file's name is kept.

Now if I could find some way to run a file and have this pop up, or even better open Finder right to the image, then I'm at 100%.

Tags

Share

About Ask MetaFilter

Ask MetaFilter is a question and answer site that covers nearly any question on earth, where members help each other solve problems. Ask MetaFilter is where thousands of life's little questions are answered.