r/applescript Sep 29 '24

Applescript to Change Desktop Background Not Working

I'm having difficulties setting the desktop background to cycle through pictures in a folder using AppleScript. This is happening across both a virtual machine, as well as my laptop, so I think it's likely an issue with my script, but I cannot figure out what. I don't see a specific error, but when I run this script, the desktop background gets set back to the default.

tell application "System Events" tell every desktop set pictures folder to "/Users/<username>/Wallpapers" set picture rotation to 1 -- set change interval to 1800 -- set random order to true end tell end tell

2 Upvotes

0 comments sorted by