[Warning!! Do not run the script in the comments here! It will work, but after a few uses, it will cause minor system errors. Use at your own risk! See the comments for a discussion on alternatives and next steps...]
A posting over on the MacNN forums got me interested in trying to come up with a way to automatically change the desktop picture. If I can find a way to change it from the terminal, then the next steps become somewhat obvious (and maybe easy?) -- write a shell script to pick a file at random from a folder, and then issue the command to update the desktop pic and get it to display. Finally, schedule that shell script as a 'cron' job to run however often you'd like a new desktop picture.
I made a bit of progress, but not much. Please read the rest if you're interested in trying to help me figure out how to make desktop pictures change automatically...
Here's what I posted over on MacNN:
The current desktop image is stored in com.apple.finder.plist, which lives in:
/Users/username/Library/Preferences. The problem is, it's stored inside a key that contains all the finder prefs:
DesktopViewOptions = {
ArrangeBy = grid;
BackgroundFlags = 0;
BackgroundPictureURL = "file://localhost/path/to/pic.jpg";
BackgroundType = PctB;
IconSize = 48;
};Those were my current settings, which you can read on your machine by typing defaults read comp.apple.finder. I was able to change the desktop picture by issuing the following command (NOTE: I've broken it up to keep the window width small, but this was all entered without hiting RETURN:defaults write com.apple.finder "DesktopViewOptions" '{
"ArrangeBy" = grid; "BackgroundFlags" = 0;
"BackgroundPictureURL" = "file://localhost/path/to/newpic.jpg";
"BackgroundType" = PctB; "IconSize" = 48; }'The problem is that if you just set the 'BackgroundPictureURL', you overwrite all the other Finder settings - I know, because I tried!. In digging around the 'man' pages for defaults, I didn't see any way to set just the one sub-key value for the "DesktopViewOptions" key; you either write one top-level key, or you whatever you write to the sub-key becomes the only value saved there.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20010318193505914