Open philipwalton opened 10 years ago
@jfelchner looks like that link 404s now.
I did find this: http://stackoverflow.com/questions/12239496/disable-ambient-light-sensor-screen-dimming-programmatically-on-os-x
and tried: defaults write com.apple.BezelServices dAuto -boolean false
But it didn't seem to work for me, has anyone else had any luck?
@philipwalton can we go ahead and close this out please?
Changes in High Sierra are making it a requirement that the majority of these settings changes are going to have to be done with AppleScript rather than using defaults
commands.
I have not found a nice way to do this so here's an AppleScript I wrote for toggling the setting.
AppleScript must open the System Preferences and click around and crap, but that's the way they want to do stuff I guess...
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.displays"
end tell
tell application "System Events"
tell window "Built-in Retina Display" of application process "System Preferences"
-- The tab group isn't loaded right away when we've just opened the "Displays" preferences
repeat until exists tab group 1
end repeat
tell tab group 1
click radio button "Display"
set cb to checkbox "Automatically adjust brightness" of group 1
click cb
if value of cb is 0 then
display notification "Disabled automatically adjust brightness"
else
display notification "Enabled automatically adjust brightness"
end if
end tell
end tell
end tell
tell application "System Preferences" to quit
In
System Preferences > Displays
there's a checkbox that is checked by default to "Automatically Adjust Brightness".I've looked for ways to turn this off programmatically but haven't found anything. I thought I'd suggest it here in hopes that someone else knows and it's of general interest to the community.