Keyboard shortcut to switch between color and grayscale

Hi! I want to know if there is a keyboard shortcut (or a way to create one) to switch between color mode and grayscale mode. Now I have to go to System Preferences -> Universal Access -> Use Grayscale -> Close the window, and then the same thing to switch back to color mode. THOSE ARE FOUR CLICKS!!!

I was trying to build something with Automator but it was unsuccessful. I think that in AppleScript maybe something can be done, but I don't know how to create those scripts.

HELP!!!

Macbook Pro 15.4 2.4GHz 4GB RAM, Mac OS X (10.5.4)

Posted on Jul 4, 2008 3:29 PM

Reply
8 replies
Sort By: 

Jul 4, 2008 4:16 PM in response to dioshy

Universal access preferences are not scriptable. That means that the only way to do what you want would be via GUI scripting which would simulate all those mouse clicks you do by hand. You can ask at the [apple script forum|http://discussions.apple.com/forum.jspa?forumID=724] to see if somebody will write a GUI script to do that for you. You'll then need a 3rd party application launcher like Quicksilver or Butler to bind a keyboard shorcut to that script.
Reply

Jul 4, 2008 4:20 PM in response to dioshy

AppleScript should work. You just need to create one that'll toggle the use grayscale option. That's stored in the com.apple.CoreGraphics.plist file. Basically, it would be something like:

*defaults write com.apple.CoreGraphics DisplayUseForcedGray 1* to turn it on and

*defaults write com.apple.CoreGraphics DisplayUseForcedGray 0* to turn it off.

Details are left for you. You might want to post to the AppleScript forum under OS X Technologies and see if anyone has an answer.
Reply

Jul 4, 2008 4:44 PM in response to baltwo

ah, that would certainly do it and it would be easy to do a script now except it seems that simply writing to this plist is not enough. one needs to force the system to read it and to refresh its settings. i don't know how to do that.
Reply

Jul 5, 2008 4:29 PM in response to baltwo

OK. This should work. Copy and past the below script into Script Editor, save it as an AppleScript application to the Desktop. Double-click it and it should change to grayscale. Double-click it again and it'll toggle back.

tell application "System Preferences" to activate
delay 1

tell application "System Events"
tell process "System Preferences"
click the menu item "Universal Access" of the menu "View" of menu bar 1
click the radio button "Seeing" of the first tab group of window "Universal Access"
click the checkbox "Use grayscale" of tab group 1 of window "Universal Access"
end tell
end tell
tell application "System Preferences" to activate
delay 1

tell application "System Events"
tell process "System Preferences"
click the menu item "Universal Access" of the menu "View" of menu bar 1
click the radio button "Seeing" of the first tab group of window "Universal Access"
click the checkbox "Use grayscale" of tab group 1 of window "Universal Access"
end tell
end tell
tell application "System Preferences" to quit
Reply

Jul 7, 2008 12:05 PM in response to baltwo

Oppps. Screwed up message poster. The script is:

tell application "System Preferences" to activate
delay 1

tell application "System Events"
tell process "System Preferences"
click the menu item "Universal Access" of the menu "View" of menu bar 1
click the radio button "Seeing" of the first tab group of window "Universal Access"
click the checkbox "Use grayscale" of tab group 1 of window "Universal Access"
end tell
end tell
tell application "System Preferences" to quit
Reply

Oct 12, 2008 6:56 AM in response to baltwo

I was looking for something my mother could use to toggle her display. She has macular degeneration and I think a grayscale option would sometimes help.

I was quite disappointed to learn that the accessibility pane of system preferences is not scriptable, and you can't record scripts there. I'm not terribly surprised though, Apple has never been serious about accessibility.

On the other hand, your script works!

Thank you.

If Apple were even a bit serious about accessibility, they'd put your script up in an "accessibility" section of their recently refurbishe AppleScript site: http://www.apple.com/applescript/index.html
Reply

Oct 12, 2008 2:58 PM in response to jfaughnan

jfaughnan wrote:
Apple has never been serious about accessibility.

If Apple were even a bit serious about accessibility, they'd put your script up in an "accessibility" section of their recently refurbishe AppleScript site


Are you living in a parallel universe? What is developing a very powerful spoken interface, free of charge to users? What is providing full access to people who can type only with one finger? What is supporting Braille displays, configurable numeric keypad commands to drive the spoken interface, and visual alerts to warn deaf users of events? What other hardware or operating system manufacturer does anything anywhere close to all this?

And no, I am not paid by Apple to say this. I simply have a totally blind wife who can now cope independently with her computer, virtually never requiring any sighted assistance, and works as a freelance translator—all thanks to Apple's commitment to accessibility.

Archie
Reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Keyboard shortcut to switch between color and grayscale

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