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

theory4themusic

macrumors newbie
Original poster
Nov 29, 2004
16
0
I'm not going to lie to you, I'm not a coder. The closest thing to coding I get is webdesign and the most basic actionscripting.

Right now I'm trying to make a Automator workflow for graphic design which will switch the system appearance to "graphite", the highlight color to "silver", and the desktop picture to a custom neutral background that I made. This way when working on a project for hours on end, I'll be [less] influenced by OSX's bright colors. As far as I can tell, the only thing automator can do is change the desktop picture. I was hoping to get arround this shortcoming by finding some sort of applescript I could run to switch the appearance prefrences, but after hours of googling I have found none. If any of you amazing people could help me out, that would be absolutely amazing :eek:

Thanks in advance!
 

HexMonkey

Administrator emeritus
Feb 5, 2004
2,240
504
New Zealand
As far as I know the only way to set the appearance settings is with GUI scripting. While it works, it is slow and likely to break in future versions of Mac OS X (the script will need slight modifications to continue working if the interface of the Appearance preferences pane changes). You also need to turn on the "Enable access for assistive devices" option in the Universal Access pane in System Preferences for it to work.

The code below should work on Mac OS X 10.4.7. Set the properties at the top to your desired settings.

Code:
property desktopPicture : "/Library/Desktop Pictures/Aqua Graphite.jpg"
property appearance : "Graphite"
property highlightColor : "Silver"

--Set the desktop picture
tell application "Finder"
	set desktop picture to file (POSIX file desktopPicture as string)
end tell

--Open the Appearance pane of System Preferences
tell application "System Preferences"
	activate
	set current pane to pane "com.apple.preference.general"
	reveal (first anchor of current pane whose name is "output")
end tell

tell application "System Events"
	tell window 1 of process "System Preferences"
		--Appearance
		tell pop up button 2
			click
			click menu item appearance of menu 1
		end tell
		delay 1
		
		--Highlight color
		tell pop up button 1
			click
			click menu item highlightColor of menu 1
		end tell
	end tell
end tell

tell application "System Preferences" to quit
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.