Using Voice control to enter a single keystroke?

I need to set up voice control on my iMac that can control YouTube (within my browser) using the YouTube keyboard shortcuts.


Using SystemPrefs->Accessibility->VoiceControl->Commands... I can set up custom voice-to-keyboardShortcuts, but only for shortcuts that use a combination of keys, eg, SHIFT-leftarrow.


How do I set up a voice command to map a voice command to a single character? For example "pause" should send the letter 'k'. When I depress the 'k' key, nothing gets entered as the "Perform:"

iMac 27″, macOS 11.2

Posted on Mar 18, 2021 11:55 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 18, 2021 1:43 PM

Hi fgreco


I have never been able to get the single keystroke to work. But as a workaround you can create a simple AppleScript to press the key, and then use a voice command to activate the AppleScript.


Use the script editor app to create the following script:


tell application "Safari" to activate

tell application "System Events" to keystroke "k"


Compile this (Script>Compile) and then save this with a file name.


Then set up a voice command, choosing Run workflow as the action, and then link to the script you just created.

Similar questions

2 replies
Question marked as Top-ranking reply

Mar 18, 2021 1:43 PM in response to fgreco

Hi fgreco


I have never been able to get the single keystroke to work. But as a workaround you can create a simple AppleScript to press the key, and then use a voice command to activate the AppleScript.


Use the script editor app to create the following script:


tell application "Safari" to activate

tell application "System Events" to keystroke "k"


Compile this (Script>Compile) and then save this with a file name.


Then set up a voice command, choosing Run workflow as the action, and then link to the script you just created.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Using Voice control to enter a single keystroke?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.