Skip to content

Instantly share code, notes, and snippets.

@nielsbom
Created January 9, 2019 19:17
Show Gist options
  • Save nielsbom/222a3c79ccf61bdc18b07733440015b8 to your computer and use it in GitHub Desktop.
Save nielsbom/222a3c79ccf61bdc18b07733440015b8 to your computer and use it in GitHub Desktop.
AppleScript to toggle macOS accessiblity for greyscale
# Tested on macOS Mojave.
# Depending on your language settings you may need to change "greyscale" to "grayscale".
tell application "System Preferences"
activate
reveal anchor "Seeing_Display" of pane id "com.apple.preference.universalaccess"
end tell
tell application "System Events" to tell process "System Preferences"
repeat until exists of checkbox "Use greyscale" of group 1 of window "Accessibility"
delay 0.1
end repeat
click the checkbox "Use greyscale" of group 1 of window "Accessibility"
end tell
tell application "System Preferences"
quit
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment