3

So I'm new to this and I might be overlooking something simple, but after failing to figure it out myself I attempted to follow the instructions from grgarside's solution to this question: https://apple.stackexchange.com/a/250276/220050

What I am trying to do is open 'System Preferences > Keyboard > Dictation' (in Sierra, 10.12.2) using an AppleScript saved as an Application I've created via Automator. I've managed to open all of the other tabs within the 'Keyboard' pane (Keyboard, Text, Shortcuts, & Input Sources) using their anchors as part of an AppleScript but not 'Dictation', the 5th and final tab.

This is my current script, which opens 'System Preferences > Keyboard' but then halts with no error message. (I did note that it activates the Search field within the Keyboard pane though, which it does not do when scripted for the other 4 tabs)

tell application "System Preferences"
activate
set current pane to pane id "com.apple.preference.keyboard"
reveal anchor "Dictation" of pane id "com.apple.preference.keyboard"
end tell

Any advice?

1

The following works for me under macOS Sierra:

tell application "System Preferences"
    activate
    set current pane to pane id "com.apple.preference.keyboard"
    delay 1
    tell application "System Events"
        click radio button "Dictation" of tab group 1 of window "Keyboard" of application process "System Preferences"
    end tell
end tell
  • Odd that you have to specify a click location for this tab just to get it to open but not for the other 4 tabs of the 'Keyboard' prefs pane, but I'll take it! I appreciate the help and i just wish I understood why it was necessary (for my own script problem-solving in the future). Thank you. – NYKg Jan 16 '17 at 5:47
  • @NYKg, I can't tell you why reveal anchor "Dictation" of pane id "com.apple.preference.keyboard" doesn't work like with the other anchors on that pane. It didn't work of me either and why I took an alternate route, which sometimes it what one has to do to get the job done. :) – user3439894 Jan 16 '17 at 12:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .