Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Vandal.

macrumors member
Original poster
Jan 3, 2013
53
0
Berlin, Germany
Hey guys,

I used to have ControlPlane change my desktop background when I arrive at the office in Mountain Lion but as they changed the way desktops are handled in Mavericks this script doesn't work anymore:

Code:
tell application "System Events"
	-- SET DESKTOP TO SPECIFIC PICTURE
	tell (every desktop whose display name is "Cinema Display X")
		set picture rotation to 0 -- (0=off, 1=interval, 2=login, 3=sleep)
		set picture to file "Macintosh HD:Users:User:Pictures:Wallpaper:Wallpaper1.jpg"
	end tell
	tell (every desktop whose display name is "Color LCD Y")
		set picture rotation to 0 -- (0=off, 1=interval, 2=login, 3=sleep)
		set picture to file "Macintosh HD:Users:User:Pictures:Wallpaper:Wallpaper2.jpg"
	end tell
end tell

I understand that HFS paths are not working anymore, but the same script with POSIX paths doesn't work either. Any chance you guys have an idea on how to do this?

Thanks,
V
 
Hey guys,

I used to have ControlPlane change my desktop background when I arrive at the office in Mountain Lion but as they changed the way desktops are handled in Mavericks this script doesn't work anymore:

Code:
tell application "System Events"
	-- SET DESKTOP TO SPECIFIC PICTURE
	tell (every desktop whose display name is "Cinema Display X")
		set picture rotation to 0 -- (0=off, 1=interval, 2=login, 3=sleep)
		set picture to file "Macintosh HD:Users:User:Pictures:Wallpaper:Wallpaper1.jpg"
	end tell
	tell (every desktop whose display name is "Color LCD Y")
		set picture rotation to 0 -- (0=off, 1=interval, 2=login, 3=sleep)
		set picture to file "Macintosh HD:Users:User:Pictures:Wallpaper:Wallpaper2.jpg"
	end tell
end tell

I understand that HFS paths are not working anymore, but the same script with POSIX paths doesn't work either. Any chance you guys have an idea on how to do this?

Thanks,
V
Maybe make a javascript version. Not sure what changed honestly with this version of Xcode.
 
Last edited:
This still works for me (10.9.3):
Code:
-- SetDesktopPic
-- BP Feb, 2011

set tlst to {}
set newtop to (path to home folder as string) & "Pictures:desktop pics folder:BigDipper 916.jpg" as alias -- sample line
--set newtop to choose file


tell application "System Events"
	set tlst to a reference to every desktop
	--set picture of item 1 of tlst to newtop  -- display 1
	set picture of item 2 of tlst to newtop -- display 2
end tell

I've got two monitors, and this script is currently set to change the desktop of monitor two to "BigDipper 916.jpg".

The commented out bits'll (--) let you set the first monitor's desktop, or choose which image you want to use.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.