1

When wallpaper settings are set to change every hour (or whatever time period) and is set to random order, it appears to be impossible to report the get, as a string, the location of the current wallpaper. For instance, my wallpaper is currently showing an image with this path (which I found by hand):

/Users/tim/Pictures/Wallpaper/4216_abstract.jpg

If I run osascript -e 'tell app "finder" to get posix path of (get desktop picture as alias)' to try to get the path of the currently set wallpaper, it reports:

/Library/Desktop Pictures/Bahamas Aerial.jpg

This particular image isn't even in the same folder as the images I have set. However this happens to be the first wallpaper I ever set when I set up this particular mac, merely 2 weeks ago (which is why I remember it).

If I hold opt and command whilst clicking on the Desktop tab of the Desktop & Screen Saver preference pane, then click on the Debug button, it reports my wallpaper as

/Users/tim/Pictures/Wallpapers/127934508754.jpg

which is different to what is actually set. BUT it also happens to be the last image i CLICKED ON in the wallpaper selection window. It isn't what is currently showing, but you can see how it's kinda related - it's what I started with in this folder before setting the randomiser option.

So how can I get the string filename and/or path of the image that is actually set as the current wallpaper?

  • The osacript command you posted reports correctly on my system. I use three Desktops, each with different pictures, I moved the Terminal from one Desktop to the next and ran the command... it reported the correct file in use on each. BTW Thanks of the Debug button trick. – user3439894 Jul 4 '15 at 11:46
  • 1
    I run two monitors, and even when it's disconnected and the terminal is on the laptop screen, it reports incorrectly for me. But it does seem to be related to the item I lasted clicked, rather then the item that has last been randomly selected. I guess it's just my system being stubborn. – frumbert Jul 5 '15 at 4:18
  • @frumbert See if this helps: apple.stackexchange.com/a/332335/279727 – Nimesh Neema Jul 29 '18 at 16:41

You must log in to answer this question.

Browse other questions tagged .