How to toggle dictation in Ventura?

Hello,

the dictation interface has changed from Mojave to Ventura and my macro to toggle dictation does not work because dictation is how a checkbox, and no longer a simple standard button

I can easily arrive at this menu with the Open Keyboard Preference Pane action below.

The button I am trying to toggle is displayed below, red arrow, lower image and is accessed via settings → keyboard → scroll down to dictation.

It can be turned on via the system settings menu (edit → Start Dictation...) as shown below, BUT once on there is no menu item to turn it off which is essential for privacy reasons.

The shortcut depicted as number 2 lower image only serves to turn on the microphone, not turn on dictation per se.

The apple script below which I create with UI Browser does not work with error message- " can't get of application process "System Settings""

thank you very much

image

tell application "System Events"
tell process "System Settings"
click checkbox 1 of group 4 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Keyboard – 100%"  of application process "System Settings"

end tell
end tell

I found the solution and will answer my own question. My AppleScript works if I delete "of application process "System Settings". I am leaving my post because it may interest other forums members with the same problem but the moderators and the master @peternlewis should delete it if they would prefer to do so

1 Like

Yep, since line 2 of your AppleScript already refers to process "System Settings", then the addition of it at the end of line 3 causes an error. Thus, removing it makes it work.

2 Likes

Would you mind sharing your complete Keyboard Maestro file I'm trying to get diction to toggle off and then back on every time I wake the system, because for some reason it starts malfunctioning if I don't do that. If I stop and then restart diction, the system will let me type and speak at the same time, where is if I don't do that if I start typing diction will turn itself off.

I'm essentially just looking for a way to restart diction. Every time my computer comes out of sleep to avoid this problem, and I think this might be the answer.