Enable voice control – this works fine in Catalina but shows an error in Monterey.
Still works but... Voice control bility Nice
Error = Select Menu Item failed to find target menu bar for View➤Voice Control➤Accessibility. Macro “MAC VOICE ENABLE” cancelled (while executing Select “Accessibility” in the Menu “View” in System Preferences).
AppleScript macro step...
tell application "System Preferences"
activate
reveal anchor "Dictation" of pane id "com.apple.preference.universalaccess"
-- activate
delay 0.5
tell application "System Events"
tell process "System Preferences"
click checkbox "Enable Voice Control" of group 1 of window "Accessibility"
end tell
end tell
delay 1
-- delay just to see it for now
tell application "System Preferences" to quit
end tell
do shell script "open -b com.apple.systempreferences " & ¬
"/System/Library/PreferencePanes/UniversalAccessPref.prefPane"
tell application "System Events"
tell its application process "System Settings"
repeat until UI element 4 of group 1 of scroll area 1 of group 1 of ¬
group 2 of splitter group 1 of group 1 of window "Accessibility" exists
delay 0.1
end repeat
click UI element 1 of group 3 of scroll area 1 of group 1 of group 2 ¬
of splitter group 1 of group 1 of window "Accessibility"
click checkbox "Voice Control" of group 1 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Voice Control"
end tell
end tell
tell application "System Settings" to quit