AppleScript: Toggle Grayscale On/Off with a Keyboard Shortcut

So OS X 10.11 – El Capitan broke an AppleScript that I had been using to toggle grayscale mode on/off, resulting in a script error:

AppleScript Error

All it took was adding a delay to fix the script (notated as a comment in the script below).

If you are running into errors with a previously used “Toggle Grayscale” AppleScript (or perhaps any AppleScript) in El Capitan, you may want to try adding “delay 1” in the line before the error occurs.

Okay, enough digression.

Fix or Create Script
    1. Open Script, located in Applications>Utilities.
    2. Copy and paste the following:
      tell application "System Preferences"
      	reveal (pane id "")
      end tell
      tell application "System Events"
      	tell process "System Preferences"
      		tell window "Accessibility"
      			tell table 1 of scroll area 1
      				-- Added "delay 1" to work in 10.11 - El Capitan
      				delay 1
      				select (row 2)
      			end tell
      			click checkbox "Use grayscale"
      		end tell
      	end tell
      end tell
      tell application "System Preferences" to quit
    3. Click Compile, then Run to verify it works. Preview:
    4. Save the script file (.scpt).

Assign Script to a Keyboard Shortcut
    1. To map the script to a keyboard shortcut, such as a F key or a multiple key combination, download, install, and run BetterTouchTool (BTT). There’s a free trial version but it’s worth the few bucks since you can do so many other things with it.

      Note: You can also use OS X’s bulit-in method described here or any other keyboard mapping tools. BTT is the simplest though, in my opinion.
    2. Open BTT’s preferences by clicking the BTT Menu Bar Icon icon, located in the menu bar. Select Global on the left side (to ensure the shortcut will work from any app), then click + Add New Shortcut.Add Shortcut in BTT
    3. Under Keyboard Shortcut, type the key or shortcut combo you wish to use (F15 in this example) and then click on the Trigger Predefined Action drop-down box.Select Shortcut in BTT
    4. In the search box that pops-up, type:
      apple script

      and then select Open Application / File / Apple Script …BTT Search Box with "Apple Script"

    5. Navigate to the saved .scpt file from earlier and select it. Click Open.Select AppleScript in BTT
    6. You can close the BTT window, as it will stay running in the background and accessible via the menu bar.

There you go!


  1. Any update to this for Sierra? It’s running fine for me in compile in Automator or Apple Script Editor (after a minor tweak to select “Scroll area 2” and “row 6”), but as soon as I save it as a service or app I get an error. It doesn’t seem to select the Display option, after it opens the Accessibility pane. Love to hear if you have it working!

    1. Same, sierra broke my AppleScript.
      I’m having trouble customizing it to access the Display anchor menu.
      `reveal anchor “Display” of pane id “”`
      spits out an error.

    2. Hey, I got it working:

      tell application “System Preferences”
      set the current pane to pane id “”

      tell application “System Events” to tell process “System Preferences”
      tell window “Accessibility”
      tell scroll area 1
      tell table 1
      select row 6

      end tell

      end tell
      click checkbox “Use grayscale”
      end tell

      end tell
      end tell
      #tell application “System Preferences” to quit

  2. ^ I made a mistake in the last script (feel free to delete it)

    Here’s is my new one, working for OSX Sierra.
    tell application “System Preferences”
    set the current pane to pane id “”
    delay 1 # needs time to open universal access
    tell application “System Events” to tell process “System Preferences” to tell window “Accessibility”
    tell scroll area 2 to tell table 1 to tell row 6 #open display preferences


    end tell

    click checkbox “Use grayscale”
    end tell
    end tell

    tell application “System Preferences” to quit

  3. Hi there. Running Mac OS High Sierra, and curious about a script to do this for the newest operating system. Tried the solution offered above (Seth’s corrected post), and got a “Syntax Error” dialog.

    1. I’ve found a solution for High-Sierra (based on code from here as well as code from Also, I’d recommend saving it as an app and putting the app in your dock to keep things simple (advice from

      High-Sierra code:

      tell application “System Preferences”
      reveal anchor “Seeing_Display” of pane id “”
      end tell
      delay 0.3
      tell application “System Events” to tell process “System Preferences” to tell window “Accessibility”
      click the checkbox “Use grayscale”
      end tell
      tell application “System Preferences”
      end tell

    1. @Joshua: Sorry, there was an error in the post. Changing all “ to ” in the script should make it run correctly.

  4. Unquestionably believe that which you stated. Your favorite reason seemed to be on the web the simplest thing
    to be aware of. I say to you, I certainly get irked while
    people consider worries that they plainly do not know about.

    You managed to hit the nail upon the top and also defined out the whole
    thing without having side effect , people can take a signal.

    Will probably be back to get more. Thanks

  5. The best in class, Depoxito present you high-end experience
    that direct the see and air of true VIP standarts, we present you
    the best tempting to high-level experience of VIPs expect in any top stop casino, grand stir casino royale offer you the further studio design element including the grand blackjack,
    offering our VIP Customer the best experience of
    a Salon privee table.
    New style table as well as feature across the room next grand roulette upgraded on our provider playtechs mini prestige roulette which delivering
    more engaging and richer playing experience.

    The new experience contains a total of seven tables including five
    blackjack tables, one roulette table and one baccarat table.
    Grand rouse casino royale has been tall hand-engineered to fit the needs
    of our customer to using it, and contains unique
    elements that is specially meant to maximize the impact value we got from our customers and
    diversify it to the existing network.
    Soon, Depoxito will fabricate an better certainty technology upon breathing casino for our VIP member, these most radical technology ever seen in stir casino including this greater than before reality.

    Which permit players to experience products on an entire additional level which is never seen since literally leaping out of the game and taking the blackjack, baccarat, roulette and
    further game into the summative entire level.

    Depoxito VIP Baccarat, we meet the expense of you the no question exclusive living VIP Baccarat that is played afterward stirring to 7 players at the same table and our severely trained beautiful stir baccarat
    dealer. And of course our VIP aficionada will character as
    if they were in point of fact sitting at one of the summit casino baccarat table.
    This immersive gaming experience creates a hugely thrill-seeking
    announce that our VIP players will find hard to surpass.

    Here is the list of conscious casino game that depoxito provide, we provide the
    widest range of sentient casino games on the spread
    around including : blackjack unlimited, blackjack prestige,
    roulette, baccarat, poker, hi-lo, sic bo, and grand sentient casino royale such as Grand
    Baccarat, Grand Blackjack and Grand Roulette for our VIP member.
    And of course as a aficionado of Depoxito you can enjoy all the
    games that we manage to pay for to you, every you compulsion to attain is just visit our site and register it solitary takes in the works to 3 minutes and subsequently youre okay to fake any game that
    you want.
    Be our VIP, monster our VIP supporter of course decided you the
    best relieve you can get from us all you infatuation to
    be a VIP supporter is no question easy. every you craving is just keep playing upon our site, addition and play a
    role considering a VIP as soon as the amount that our company had written, keep playing and our customer bolster will gate you that you are promoted to become
    a VIP advocate on our site.

  6. I cannot express enough thanks for this script. It is the end of the 2019 year and I have struggled to find a simple shortcut solution for grayscale that works properly. This is an essential feature that should have been implemented by Apple in the beginning.

    Ontario, Canada

  7. Sbobet is a trusted gambling site that operates to foster every fans of online gambling in the world.
    Founded in 2010, it didn’t allow long for Sbobet to
    become the biggest online site in Asia and like it comes to the amount of betting child
    maintenance that rotates every week, Sbobet is then one of the biggest sites in the world.

    Sbobet is entirely popular, especially along with Asian bettors, the excuse is that the site has been awarded as the best gambling operator for
    two years in a row. It offers a variant of football betting considering completely low margins considering compared to
    extra sites in its class.

  8. all right and thank you for visiting online casino agents for
    Indonesia. Here we are here to come up with the money for
    entrance for fans of sbobet casino who desire to associate the international agent site Promosbobet.

    The products offered are enormously diverse and are agreed
    the best choice. Derived from providers that have credibility and
    have been proven to have the best predicate in serving their customers.
    Providers next Sbobet, Maxbet and many more.

    As the best online casino and soccer gambling site in Indonesia.

    We allow maximum utility in the manner of customer preserve that works
    online 24 full hours every day. for that reason members
    can play a part whenever and wherever without
    fearing to tilt the possibility of difficulties or confusion.

  9. Daftar Situs Judi Online Terbaik in Dalam negri
    Situsalternatif are the collection of lists of the greatest
    online gambling sites from all recognized bookies / providers in Indonesia.
    Info on online gambling internet sites listed on this specific page is definitely
    altering, because we only provide sites that get good reviews.

    Each site offers some informative about the games available, deposit transaction alternatives, and alternative links.

    Collection of Situs Alternatif and Daftar Judi Online Terbaik
    Playing on gambling internet sites is not completely easy, among the problems frequently experienced by players will be difficulty accessing typically the site where
    you can enjoy due to site blocking. Therefore, the Alternative Site collects option links here which often are extremely useful to be able to help gamblers
    in order to easily login plus daftar taruhan online.
    Within addition, you avoid need to be worried about the link jalan keluar judi that we
    provide, of course a person can access it easily and for free.

  10. Listing of Alternative Linksbo Hyperlinks
    Today is increasingly developing, rendering it less difficult for folks to accessibility computerized networks.
    Right up until now there are several on-line gambling games
    that can be played by anybody online. Therefore, gambling lovers no
    lengthier require to the particular casino to play betting,
    this is very simple for them to play anytime
    plus anywhere without limitations.

  11. Betberry is one of the leading sites in the
    particular online gambling industry in Indonesia that will provides slots, online
    casino, sportsbook, shooting species of fish, money claws, poker, cockfighting and
    lotto. We have launched seamless technology that provides an easy remedy
    for online gambling gamers. With just one IDENTIFICATION, you can enjoy all the video games
    from various companies without having to move funds from
    one provider to be able to another. Betberry by itself is certified by simply the Nexus Powerplant, which means all of us offer services
    to players for all those Indonesian players legally.

  12. UserbolaVIP Alternative Link
    Through online gambling video games, you will get income as well as amusement without having to be able to leave your comfort at home.

    Many of the sites that provides the greatest gambling online
    games in Indonesia is UserbolaVIP. Through this internet site,
    you can locate a number of00 interesting in addition to popular gambling video games such
    as soccer wagering, online slots, on-line
    casino, lottery, online poker, arcade online games and
    so on.

    Unlike other gambling sites that you could discover on the internet,
    UserbolaVIP gives you various conveniences inside online gambling games.
    As a brand new member, you will be provided a
    lot of convenience in enrolling, getting lucrative bonus deals, including an alternate UserbolaVIP link that will you can entry without having to experience troubles being blocked
    or perhaps having to use a VPN.

Leave a Reply

Your email address will not be published. Required fields are marked *