How would I go about programmatically changing the desktop background in Mac OS X? I\'d like to use python, but I\'m interested in any way possible. Could I hook up to Ter
From python, if you have appscript installed (sudo easy_install appscript
), you can simply do
from appscript import app, mactypes
app('Finder').desktop_picture.set(mactypes.File('/your/filename.jpg'))
Otherwise, this applescript will change the desktop background
tell application "Finder"
set desktop picture to POSIX file "/your/filename.jpg"
end tell
You can run it from the command line using osascript, or from Python using something like
import subprocess
SCRIPT = """/usr/bin/osascript<