Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Start dictation from terminal or appleScript

Is there anyway to start dictation from terminal or appleScript?

THe reason I ask is that I want to make a voice control program that can get input through dictation.

now I can only start a workflow with a voice command, instead of start a dictation and use it as input of the program.

Anyone has ideas? Thanks.

MacBook Pro with Retina display, OS X El Capitan (10.11.2)

Posted on Mar 30, 2016 2:54 PM

Reply
10 replies

Mar 30, 2016 3:36 PM in response to casouri

This might be helpful.


Also, don't rule out the System Preferences : Accessibility : Dictation : Dictation Commands… where you have the ability to create a new voice command that performs the actions in a specified Automator Workflow.


One of my annoyances was that some applications export a PDF and then hide the extension. I created an Automator Workflow (restore_file_extension.workflow) that by selecting the file, and simply saying “Show Extension,” the workflow would tell Finder to display the selected filename extension. You can watch the extension abruptly appear. That Automator workflow file can be anywhere in your home folder. The perform selection (below) lets you walk to the file location and select it. Instead of an Automator Workflow, it can be just a compiled (.scpt/.scptd) AppleScript. You would press fn fn prior to this paragraph to have dictation listening.


User uploaded file

The Automator Workflow is comprised of a sole Run AppleScript action:

User uploaded file

Mar 30, 2016 8:46 PM in response to casouri

Can I start a dictation with it and get the sentence from it?

Yes. Use something like:


tell application "SpeechRecognitionServer"

set theResponse to listen for {"1", "2", "3", "4", "5"} with prompt "pick a number between 1 and 5"

say "You picked " & theResponse

end tell


Note that the phrase that SpeechRecognitionServer detected is returned in theResponse.

Start dictation from terminal or appleScript

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