Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Change desktop picture without Finder restart Desktop
Here is a script to change the desktop picture without relaunching the Finder (as was required in the method listed in this hint). I've included an example I use to get a webcam image and make that image the desktop. Customize at will. The trick is using osascript to run an AppleScript program. Here's the script:
#!/bin/csh -f

rm -f ./BURLINGTONLARGE.JPG
wget http://www.hazecam.net/images/photos-large/
BURLINGTONLARGE.JPG >& /dev/null
set pic=BURLIGNTONLARGE.JPG
set here=`pwd`
set myFile=$here/$pic

/usr/bin/osascript <<END
tell application "Finder"
set pFile to POSIX file "$myFile" as string
set desktop picture to file pFile
end tell
END
NOTE: The 'wget' line has been broken into two rows for easier reading. Enter it as one line with no spaces between the "/" and the "BUR..." bit. Save the script, make it executable (chmod 755), and it's ready for use!
    •    
  • Currently 3.25 / 5
  You rated: 3 / 5 (4 votes cast)
 
[16,347 views]  

Change desktop picture without Finder restart | 7 comments | Create New Account
Click here to return to the 'Change desktop picture without Finder restart' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
SwitchPic
Authored by: zephc on Aug 06, '02 04:37:53PM

get SwitchPic, a nice System Preferences plugin that (also operable via a menubar item) which will let you set the desktop to any pic u want and actually let you keep the pic size correct on the desktop rather than being just tiled or stretched. In addition, it will rotate the the pic at any given interval, and you can create collections of pics (ala iTunes playlists) that it can select from, and even the frequency (lowest, lower, normal, higher, highest) at which it rotates.
check out http://homepage.mac.com/maceuph/apps/SwitchPic



[ Reply to This | # ]
Multiple monitors
Authored by: Skipper on Aug 07, '02 02:22:16AM

How do you modify this to tell the finder to change the desktop picture of a second monitor?



[ Reply to This | # ]
Multiple monitors
Authored by: Skipper on Aug 07, '02 02:30:43AM

How do you modify this to tell the finder to change the desktop picture of a second monitor?



[ Reply to This | # ]
Multiple monitors
Authored by: laytonred on Jan 28, '05 03:02:20PM

did you ever get this to work.....i can't seem to get applescript to specify what monitor....although using quicktime Pro you can specify which monitor within the present movie option...so i would think it is possible.



[ Reply to This | # ]
THIS HINT REQUIRES FINK
Authored by: perdedor on Aug 07, '02 11:31:59AM

wget is not part of the standard os x install, therefore this hint won't work unless you installed fink and then wget, or wget from source, or the forked.net people released a port.

changing the wget line to:
curl -O http://www.hazecam.net/images/photos-large/BURLINGTONLARGE.JPG


should allow this to work on a standard OS X install.



[ Reply to This | # ]
Change desktop picture without Finder restart
Authored by: weekiwachee on Aug 17, '10 06:37:49AM

I apologize i am very ignorant with apple scripts.

I get the following error message when i try your script...

execution error: Canít make POSIX file "" of application "Finder" into type string. (-1700)

A search online has not helped.

Thank you very much.



[ Reply to This | # ]
Change desktop picture without Finder restart
Authored by: tedw on Aug 17, '10 02:39:16PM

I created a new hint with an updated script. It should post soon.



[ Reply to This | # ]