Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save adriang133/d0b92a349d097e63a1790a0bfd0eeaf9 to your computer and use it in GitHub Desktop.
Save adriang133/d0b92a349d097e63a1790a0bfd0eeaf9 to your computer and use it in GitHub Desktop.
Workaround the HDR bug of macOS Catalina 10.15.4
#!/usr/bin/osascript
tell application "System Preferences"
activate
end tell
tell application "System Events"
tell process "System Preferences"
activate
delay 1
click menu item "Displays" of menu "View" of menu bar 1
delay 1
tell window "LG HDR 4K"
delay 1
if (exists tab group 1) then
click radio button "Display" of tab group 1
set HDRCheckbox to checkbox "High Dynamic Range" of tab group 1
if (exists HDRCheckbox) then
click HDRCheckbox
tell HDRCheckbox
if (its value as boolean) then
delay 15
click HDRCheckbox
end if
end tell
end if
end if
end tell
end tell
end tell
@mhschaap
Copy link

mhschaap commented Sep 16, 2020

If it's not working for you, then maybe you're closing the settings window before the script gets a chance to finish ?

Hi @adriang133; it works! I have saved it as an application, moved it to /Applications (sudo) and added it to the login applications. So it starts automatically at login. Could the preferences screen also be closed automatically? click menu item "Displays" of menu "View" of menu bar 1; but then afterwards close?

See ToggleHDRCatalina on the screenshot
Screenshot 2020-09-16 at 21 11 39

Added October 4th 2020:
been using it for quite a while now and in principle it works, however: after completion of the script, I need to power-off the monitor, by the joystick-button and power it on again. Without this action it does not work.
Still I am quite happy with the script! so Thanks!!

@mhschaap
Copy link

mhschaap commented Oct 6, 2020

The script is fine, but still I had some issues left; making a custom EDID file and putting this in /S/L/Displays..../Overrides completely disables HDR; so no script to be run and no flickering. This may interest other readers: https://www.tonymacx86.com/threads/10-15-4-update-how-to-disable-hdr-support.293991

However, if you would like to keep HDR as an option, you should use this script. I don't need HDR. Thanks @adriang133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment