Skip to content

Instantly share code, notes, and snippets.

@tknickman
Created June 16, 2018 01:29
Show Gist options
  • Save tknickman/093e6c6d1d7f9ffb216a1b6d30606f31 to your computer and use it in GitHub Desktop.
Save tknickman/093e6c6d1d7f9ffb216a1b6d30606f31 to your computer and use it in GitHub Desktop.
Applescript to automate changing brightness of multiple LG UltraFine 5K (or 4K) monitors
set monitorList to {"LG UltraFine (1)", "LG UltraFine (2)"}
set brightnessValue to 0.7
tell application "System Preferences"
reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
end tell
tell application "System Events"
repeat with monitor in monitorList
set value of slider 1 of group 1 of tab group 1 of window monitor of process "System Preferences" to brightnessValue
end repeat
end tell
quit application "System Preferences"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment