Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Use Grayscale (Keyboard Shortcut)

Hello. I'm using macOS High Sierra (10.13.2) and would like to set a keyboard shortcut for Use Grayscale in the Display screen of the Accessibility menu of System Preferences. There are pre-set keyboard shortcuts for other keyboard settings (Contrast, Invert Colors) but I can't find a way to set one for Use Grayscale.


Web searches and Apple Support Community posts reveal ideas for past versions of macOS, but nothing for High Sierra.


Any tips or suggestions will be appreciated.


Thanks very much.

iMac (Retina 4K, 21.5-inch, 2017), macOS High Sierra (10.13.2)

Posted on Jan 20, 2018 6:06 AM

Reply
Question marked as Best reply

Posted on Jan 20, 2018 6:49 PM

You can make an Automator Service like the following:


User uploaded file


Here is a closer look at the AppleScript in this Service:


-- Reference: https://apple.stackexchange.com/questions/240446/how-to-enable-disable-grayscale -mode-in-accessibility-via-terminal-app

tell application "System Preferences"

launch

reveal anchor "Seeing_Display" of pane id "com.apple.preference.universalaccess"

end tell

tell application "System Events" to tell process "System Preferences"

delay 1

click checkbox "Use grayscale" of window "Accessibility"

end tell

tell application "System Preferences" to if it is running then quit

return

I saved the Automator Service with the name GrayScale. In System Preferences : Keyboard panel : Shortcuts : Services : General, I double-clicked the right-hand side of the GrayScale entry, and gave it the keyboard shortcut of control+G. This will appear under the Finder's Service menu.


Because this is using GUI scripting, you will immediately get two stacked messages: 1) That Automator has encountered an error in the service, and right behind it, and the real reason, is the following dialog:

User uploaded file

Click the "Open System Preferences button, and you will be taken to the Security & Privacy panel : Accessibility. Check the Finder entry to grant it authority, and afterward your keyboard shortcut will toggle Grayscale as expected.

User uploaded file

3 replies
Question marked as Best reply

Jan 20, 2018 6:49 PM in response to Jeff Wexler

You can make an Automator Service like the following:


User uploaded file


Here is a closer look at the AppleScript in this Service:


-- Reference: https://apple.stackexchange.com/questions/240446/how-to-enable-disable-grayscale -mode-in-accessibility-via-terminal-app

tell application "System Preferences"

launch

reveal anchor "Seeing_Display" of pane id "com.apple.preference.universalaccess"

end tell

tell application "System Events" to tell process "System Preferences"

delay 1

click checkbox "Use grayscale" of window "Accessibility"

end tell

tell application "System Preferences" to if it is running then quit

return

I saved the Automator Service with the name GrayScale. In System Preferences : Keyboard panel : Shortcuts : Services : General, I double-clicked the right-hand side of the GrayScale entry, and gave it the keyboard shortcut of control+G. This will appear under the Finder's Service menu.


Because this is using GUI scripting, you will immediately get two stacked messages: 1) That Automator has encountered an error in the service, and right behind it, and the real reason, is the following dialog:

User uploaded file

Click the "Open System Preferences button, and you will be taken to the Security & Privacy panel : Accessibility. Check the Finder entry to grant it authority, and afterward your keyboard shortcut will toggle Grayscale as expected.

User uploaded file

Use Grayscale (Keyboard Shortcut)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.