Need help with a desktop changer script...

I’m trying to write a script to change the desktop to a nuetral grey so that when I’m doing photoediting I can use a non-interfering colour as the background. Ideally I want to develop two scripts, so that having changed the desktop, edited the photos I can then change it back to the colour/picture that I want. I think this should be fairly easy once I done the first one, as it’ll just be a matter of tinkering with the code slightly to create a reversal script.

However I’ve hit a bit of a wall, (I’m fairly new to scripting) and I’d appreciate any help that forum members can give me. The code, as it is right now, is below. Please feel free to use and amend.

Michael Preston

:cool:

tell application "Finder"
	activate
	select window of desktop
	select window of desktop
	tell application "System Preferences"
		activate
	end tell
	
	tell application "System Events"
		tell process "System Preferences"
			click menu item "Desktop & Screen Saver" of menu "View" of menu bar 1
			delay 3
			tell window "Desktop & Screen Saver"
				if (exists tab group 1) then
					tell tab group 1
						click radio button "Desktop"
						delay 3
						click radio button "Solid Colors"
						delay 3
						select "Solid Aqua Graphite"
					end tell
				end if
			end tell
		end tell
	end tell
end tell

Hi Michael,

You don’t need System Events to change the desktop picture. Here’s an example:

set dtpf to (path to "dtpÆ’" as string)
set colors_folder to (dtpf & "Solid Colors:") as alias
tell application "Finder" to set desktop picture to file "Solid Aqua Graphite.png" of folder colors_folder

gl,

Hi Michael,

it’s much easier:

tell application "Finder"
	set desktop picture to ((path to desktop pictures folder as Unicode text) & "Solid Colors:Solid Aqua Graphite.png")
end tell

Although as shown there are Applescript ways of doing what you want, over on macosxhints Mikey-San wrote an app to do what i think you want.
The thread is a long one but you can find the app here Here its free