Last active
August 29, 2015 14:11
-
-
Save jamesnvc/061e5a480af8944565f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set spacenumber to 9 | |
tell application "System Events" | |
set _desktops to every desktop | |
if (count of _desktops) > 1 then | |
-- if you have multiple displays (eg: external monitor) ask which | |
display dialog "Choose your screen." buttons (get display name of every desktop) default button 1 | |
set _display to the button returned of the result | |
else | |
-- else set the one display as selected | |
set _display to display name of the first desktop | |
end if | |
set new_file to choose file with prompt "Choose an image." | |
repeat with i from 0 to (spacenumber - 1) | |
delay 1 | |
tell (every desktop whose display name is _display) to set picture to new_file as alias | |
tell process "WindowServer" to key code {124} using {control down, command down} -- Go to the next space | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment