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 -fNOTE: 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!
rm -f ./BURLINGTONLARGE.JPG
BURLINGTONLARGE.JPG >& /dev/null
tell application "Finder"
set pFile to POSIX file "$myFile" as string
set desktop picture to file pFile