-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSwitch HDR.AppleScript
41 lines (30 loc) · 1.1 KB
/
Switch HDR.AppleScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
if application "System Preferences" is running then
tell application "System Preferences" to quit
end if
tell application "System Preferences"
set the current pane to pane id "com.apple.preference.displays"
activate
end tell
tell application "System Events" to tell process "System Preferences"
repeat until button "Display Settings…" of window "Displays" exists
end repeat
click button "Display Settings…" of window "Displays"
repeat until checkbox "High Dynamic Range, Automatically adjust the display to show high dynamic range content." of sheet 1 of window "Displays" exists
end repeat
set theCheckbox to checkbox "High Dynamic Range, Automatically adjust the display to show high dynamic range content." of sheet 1 of window "Displays"
tell theCheckbox
if not (its value as boolean) then
set hdrstate to "hdroff"
else
set hdrstate to "hdron"
end if
click theCheckbox
end tell
delay 1
click button "Done" of sheet 1 of window "Displays"
end tell
delay 1
if application "System Preferences" is running then
tell application "System Preferences" to quit
end if
return hdrstate