AppleScript to open Accessibility Options

Discussion in 'Mac Programming' started by glycon, Nov 23, 2016.

  1. glycon, Nov 23, 2016
    Last edited: Nov 23, 2016

    glycon macrumors newbie

    Joined:
    Sep 24, 2005
    #1
    I mouse and type with my head through macOS Sierra Dwell Control.

    What am I doing wrong that the following AppleScript does not bring up the Accessibilty Options panel as literally pressing Option-Command-F5 does?



    Code:
    on run
    
    tell application "System Events"
    
    key code 96 using {option down, command down}
    
    end tell
    
    end run
    
     
  2. superscape macrumors 6502a

    superscape

    Joined:
    Feb 12, 2008
    Location:
    East Riding of Yorkshire, UK
    #2
    Not sure, but you can get into them in a different way (on El Capitan anyway):

    Code:
    tell application "System Preferences"
       activate
       set current pane to pane "com.apple.preference.universalaccess"
    end tell
    
     
  3. glycon, Nov 25, 2016
    Last edited: Nov 25, 2016

    glycon thread starter macrumors newbie

    Joined:
    Sep 24, 2005
    #3
    That's good but I need this:

    [​IMG]

    Opt-Cmd-F5 is the default shortcut.
     
  4. superscape macrumors 6502a

    superscape

    Joined:
    Feb 12, 2008
    Location:
    East Riding of Yorkshire, UK
    #4
    Mmmm... unfortunately I'm still on El Capitan so I don't have that System Pref. You'd need to see if you can get hold of the panel's ID (which is what I did in my earlier example). The script below should give you a list of your System Preferences' IDs. If you see something that looks like it might be the one you need, substitute it into my earlier example.

    Code:
    tell application "System Preferences"
       activate
       set thePanes to (id of every pane)
    end tell
    choose from list thePanes
    
     
  5. glycon thread starter macrumors newbie

    Joined:
    Sep 24, 2005
    #5
    Thanks for trying to help me out. The panel seems to spawn from Assistive Control.app which appears briefly in Activity Monitor when I press the hotkey but I haven't located it yet to point Script Editor to it.
     
  6. glycon thread starter macrumors newbie

    Joined:
    Sep 24, 2005
    #6
    upon a reinstall in place of 10.12.2 that fixed a separate graphics issue now my script works as expected
     

Share This Page