Simple change background image issues

Why does this work: (make the desktop a random image in the folder)

tell application "Finder"
	set foo to files of (folder "Pictures:Wallpapers" of home) as alias list
	set desktop picture to some item of foo
end tell

and this not: (specify a specific file)

tell application "Finder"
	set foo to "Flow.jpg" of (folder "Library:Desktop Pictures") as alias
	set desktop picture to foo
end tell

I am a complete noob to applescript so please cut me some slack. I am simply trying to create a script that I can use to make all of the background images uniform on a network via remote desktop.

thanks in advance

Hi Benjamin,

The references you used are not the same. The one in the second script is wrong.It starts with “Library”. What folder are you trying to get pictures from in the second script?

gl,

In the second script I’m simply trying to pull a picture that is loaded on every os x machine… It is from the /Library/Desktop Pictures/ folder.

I’m not concearned about the files or folders…
This won’t work either and it has the same location…

tell application "Finder"
	set foo to "Flow.jpg" of (folder "Pictures:Wallpapers" of home) as alias
	set desktop picture to foo
end tell

Ugh, I got this to work.

tell application "Finder"
	set foo to file "Pictures:Wallpapers:Graphite.jpg" of home
	set desktop picture to foo
end tell

But now I can’t get it to work out of the “/Library/Desktop Pictures/file.jpg” folder

Ah, thank you very much… Is there any sort of API that I can use or study?