Created
July 7, 2011 18:02
-
-
Save gfontenot/1070118 to your computer and use it in GitHub Desktop.
Ruby script to change the desktop to a new image on Mac OSX
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
#!/usr/bin/env ruby | |
def change_desktop image_path | |
`osascript <<EOD | |
tell application "Finder" | |
set theFile to POSIX file "#{image_path}" | |
set desktop picture to theFile | |
end tell | |
EOD | |
` | |
end | |
image_path = "#{Dir.pwd}/#{ARGV[0]}" | |
change_desktop image_path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment