|
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
|