Skip to content

Instantly share code, notes, and snippets.

@billynyh
Created March 10, 2015 07:39
Show Gist options
  • Save billynyh/9c513d27b6b28ca56281 to your computer and use it in GitHub Desktop.
Save billynyh/9c513d27b6b28ca56281 to your computer and use it in GitHub Desktop.
stupid script to change all wallpaper in mac
set bgFile to "path/to/wallpaper.jpg"
tell application "System Events"
repeat with i from 1 to 7
set theDesktops to (a reference to every desktop)
repeat with x from 1 to (count theDesktops)
set picture of item x of the theDesktops to bgFile
end repeat
delay 1
key code 124 using control down
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment