i have an apple script which set's an image (Picture 1.png) as the desktop background, and than deletes the Picture 1.png file. that's fine and works. but when make another new Picture 1.png, and run the script again, the desktop picture doesn't change because it thinks that it's the same Picture 1.png that it has been already set too - but i know the script runs thru because the new Picture 1.png file will be deleted (even though the desktop picture will not update).
i'm would like to force the Finder to update the desktop picture file because even though it's the same file name, it's a different image... i'm totally out of ideas... any thoughts?
i'm would like to force the Finder to update the desktop picture file because even though it's the same file name, it's a different image... i'm totally out of ideas... any thoughts?
Code:
set newDesktopPicture to POSIX file "/Users/[I](myname)[/I]/Desktop/Picture 1.png"
tell application "Finder"
set desktop picture to alias newDesktopPicture
tell application "Finder"
do shell script ("rm \"" & POSIX path of newDesktopPicture & "\"")
end tell
end tell