Previously, this could be done with an Applescript on Mountain Lion. This is because it targets System Preferences to adjust the brightness. System Preferences no longer has this setting in OSX 10.9 Mavericks. Any guidance on this issue would be appreciated. Thanks.
Correction, my projector is plugged in all of the time so when the script is run, it jumps to the "projector" pane instead of the "built-in display" pane where the slider is located. I was thinking something like this would target the "Built-in Display" pane that has the slider. I can't seem to get it to work though.
tell application "System Preferences"
reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
delay 1
set value of slider 1 of group 1 of tab group 1 of window 1 of process "System Preferences" to 0
end tell
quit
end tell
You might also use brightness.c:
brightness 1 # set the brightness to the maximum on all displays
brightness -d 0 0.5 # set the brightness to 50% on the first display
If others search for how to put displays to sleep, you can use pmset displaysleepnow
in 10.9 and later:
do shell script "pmset displaysleepnow"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With