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

Lostanddamned

macrumors 6502a
Original poster
May 3, 2009
677
357
London, UK
I'm currently writing an applescript to use as an alarm clock (playing itunes at full blast, displaying my dashboard with the weather and news), but of course, to actually get to sleep I have had to turn the brightness of the monitor right down, which means that I have to manually turn it back up again.

The Script I am currently using is
Code:
tell application "System Preferences"
	activate
	set current pane to pane "com.apple.preference.displays"
	tell application "System Events"
		delay 5
		set value of slider 1 of group 2 of tab group 1 of window "Color LCD" of process "System Preferences" to 0.5
		delay 5
	end tell
	quit
end tell

But this returns the error "System Events got an error: Can't set window "Color LCD" of process "System Processes" to 0.5"

any ideas what I am doing wrong?
 

auschase

macrumors newbie
Sep 26, 2011
9
0
Change "Color LCD" to 1:
PHP:
tell application "System Preferences"
	activate
	set current pane to pane "com.apple.preference.displays"
	tell application "System Events"
		delay 1
		set value of slider 1 of group 2 of tab group 1 of window 1 of process "System Preferences" to 0.5
		delay 1
	end tell
	quit
end tell
 

spookybathtub

macrumors newbie
Feb 15, 2008
27
1
"Color LCD" should work, as long as that is the correct name of your monitor. When you open display prefs yourself, what does it say at the top of the window? That is the name of your display.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.