This AppleScript may or may not work on your system. On my Mac book Pro running the latest version of Sierra, this following code enables the "Automatically adjust brightness" checkbox If your current time is between 6 am and 6 pm, Otherwise it disables that checkbox If it is already selected.
if hours of (current date) is greater than 6 then
if hours of (current date) is less than 18 then
tell application "System Preferences"
reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
tell checkbox "Automatically adjust brightness" of group 2 of tab group 1 to if value is 0 then click
end tell
else
tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
tell checkbox "Automatically adjust brightness" of group 2 of tab group 1 to if value is 1 then click
end tell
end if
end if
tell application "System Preferences"
quit
end tell
You can adjust the hours values at the top of the script to suit your needs
If your display preferences looks like this picture... This script should work for you.
