I'm writing a bash script that takes care of setting the desktop background on my mac. I can set the desktop background with:
$ osascript -e 'tell app "Finder" to set desktop picture to POSIX file "/Library/Desktop Pictures/Solid Colors/Solid White.png"'
However, I also need to GET the path of the desktop picture. The closest I've gotten is:
$ osascript -e 'tell app "Finder" to get desktop picture'
This returns the path of the desktop picture but in a really weird format that I can't use:
document file Solid White.png of folder Solid Colors of folder Desktop Pictures of folder Library of startup disk
Is there any way I can get the path of the current desktop picture that would return:
/Library/Desktop\ Pictures/Solid\ Colors/Solid\ White.png
?
Can’t make missing value into type alias.
– Phelps