Keyboard shortcut to switch between color…
apple Verified ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
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!!!
8 replies
Sign in or join Beachball Help to reply.
- 0
V.K. ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
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.
- 0
baltwo ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
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.
- 0
V.K. ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
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.
- 0
baltwo ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Yes, I saw that behavior. That's why I indicated details are left as an exercise and suggested posting to the AS forum.
- 0
baltwo ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
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 1tell 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 1tell 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 - 0
baltwo ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Oppps. Screwed up message poster. The script is:
tell application "System Preferences" to activate
delay 1tell 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 - 0
jfaughnan ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
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 - 0
Archie Robertson ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
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 siteAre 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