View Single Post
Old 07-19-2006, 09:05 PM   #6
Bugbyte
Admin. Don't bug or I'll byte.
Bugbyte's CarPC Specs
 
Bugbyte's Avatar
 
Join Date: Sep 2004
Location: Corning, NY
Vehicle: 2001 VW Beetle
Posts: 4,585
My Photos: ()
Following is an Applescript handler that use GUI scripting to control the Display preference pane. I presume if your screen does not have a "Brightness" slider that this script will error. It works fine on my Apple studio display but I haven't tested it on the Xenarc.

Cut and paste the code below the dashes and run it in applescript studio to try it out. If it works, save one Applescript with the dim value and save a different one with the bright value. You should be able to dim/bright by running the appropriate script.

------------------------------------------------------------

ChangeBrightness(.5) --Set this value between 0 and 1 to adjust brightness

on ChangeBrightness(BrightnessValue)

tell application "System Preferences"
--activate
set current pane to pane "com.apple.preference.displays"
end tell
tell application "System Events" to tell process "System Preferences"

tell radio button "Display" of tab group 1 of window 1 to if value is 0 then
repeat until value is 1
click
end repeat
end if


tell slider 1 of group 2 of tab group 1 of window 1 to set value to BrightnessValue
end tell
--tell application "System Preferences" to quit
end ChangeBrightness
__________________
-Where in the world is the iBug?
-Find out about theiBug
-Attention Newbies! Have you seen the FAQ Emporium?
-No time to figure it out? Take 5 minutes to view the Car PC 101 video
Bugbyte is offline   Reply With Quote