Any Script to find current desktop image in Yosemite?

I have a folder with 3000 images that contain all my desktop images, I’ve set them to rotate every 15 minutes. Sometimes I want to identify the file name of the current desktop image so I can delete it or identify it as a favorite.

Does anyone have an apple script that will find the location of the current desktop image in OS X Yosemite (10.10)? All the solutions I’ve found in forums only apply for earlier (sometimes much earlier) operating systems.

tell application "Finder"
	set mypic to desktop picture as text
	display dialog POSIX path of mypic
end tell

I’ve tried the above script before. When I run this script it brings up the location of the same image irregardless of what wallpaper is being displayed at the time on my desktop.This script apparently worked for an earlier version of Mac OS X, but it does not work in Yosemite. Any other ideas?


This one still works (post #11 in the other thread to which you posted), with the same proviso that nothing else in the source folder must be opened between the picture changing and the script being run.

Awesome, that works great! Is there a way to make the script automatically copy the results to the clipboard?

Yeah. Just ‘set the clipboard’ to the result: :slight_smile:

tell application "System Events" to set pFldr to pictures folder of current desktop
set picturePath to pFldr & "/" & paragraph 1 of (do shell script "ls -tu " & quoted form of pFldr)
set the clipboard to picturePath

Cool! Works Perfectly! Thanks!