Skip to content

Instantly share code, notes, and snippets.

@matthewspear
Created April 27, 2020 13:32
Show Gist options
  • Save matthewspear/9fb35ea225ddad6cd7e58d5d3d06010a to your computer and use it in GitHub Desktop.
Save matthewspear/9fb35ea225ddad6cd7e58d5d3d06010a to your computer and use it in GitHub Desktop.
Slightly hacky script to toggle macOS greyscale mode on / off.
tell application "System Preferences"
set current pane to pane id "com.apple.preference.universalaccess"
delay 1
tell application "System Events" to tell process "System Preferences" to tell window "Accessibility"
select row 5 of table 1 of scroll area 1
tell tab group 1 of group 1
click radio button "Colour Filters"
click pop up button 1
click menu item "Greyscale" of menu 1 of pop up button 1
click checkbox "Enable Colour Filters"
end tell
end tell
end tell
tell application "System Preferences" to quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment