


$ osascript -e 'tell application "Finder" to set desktop picture to POSIX file "~/Desktop/cabo-san-lucas.jpg"' Osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/path/to/picture.jpg"'įor example, to set a picture on the desktop called “cabo-san-lucas.jpg” as the wallpaper: To change the desktop wallpaper from the command line of OS X you will use the osascript command, which is actually just the command line front end to AppleScript, as you’ll see with some basic applescript in the syntax: Of course, for most Mac users, you’ll set wallpaper from OS X System Preferences or by right-clicking on a picture somewhere in the file system, which is undoubtedly the fastest and most efficient means of changing the Macs desktop background, but for those who like to be a bit more hands on or who need to know how to adjust desktop background pictures from the command line, read on.
