×

VCOF0067

OmniFocus: Dictate Note

Displays a dictation input view for entering text to be used to either replace or append to the note of the selected project or task.

Scope and Syntax

Language: English (United States 🇺🇸 · Great Britain 🇬🇧 · Australia 🇦🇺 · Canada 🇨🇦) • Scope: OmniFocus

Command phrase variations (words in [brackets] are optional):

Requirements

Installing voice commands on iOS/iPadOS

While Apple’s mobile operating systems currently do not support the Open URL action used in the voice commands files provided on this website, you can still create and use customized Omni Automation voice commands for iPhones and iPads!

To create your voice commands, we’ll use specialized Shorcuts workflows that you can “tap-to-install” from the various example pages. Simply follow these steps or view the illustrated instructions here:

  1. First, install an Omni Automation shortcut from one of the provided links. (below)
  2. Next, in the mobile Settings app, tap AccessibilityVoice ControlCustomize CommandsCustomCreate New Command… and in the forthcoming New Command interface select the installed shortcut as the value for the “Action” parameter.
  3. Enter one of the command phrases from the example’s documentation page (above) for the value of the “Phrase” property, and…
  4. Finally, set the value of the “Application” parameter to either “Any” for global access or choose the Omni app to target from the provided list of installed applications.

You can then activate Voice Control and use your voice command to trigger the shortcut to run the Omni Automation script!

Downloads

NOTE: Installation instructions for Shortcut-based command on macOS, are found here.

Shortcut

(NOTE: detailed documentation regarding the use of Shortcuts with Omni Automation can be found in the Shortcuts Section of this website.)

The action of this voice command is performed by the execution of the shortcut linked above. This shortcut contains two Omni Automation scripts: the first for identifying the selected project or task, and the second for appending or replacing the note of the selected item with the contents of the dictation.

Screenshot

The following script (1 of 2) checks for a single selected project or task, and then passes the “primary key identifier” of the object to the next action in the shortcut.

Identify Selected Item


(async () => { try { function createUtterance(textToSpeak){ AlexID = ( (app.platformName === "macOS") ? "com.apple.speech.synthesis.voice.Alex" : "com.apple.speech.voice.Alex" ) voiceObj = Speech.Voice.withIdentifier(AlexID) voiceRate = 0.4 utterance = new Speech.Utterance(textToSpeak) utterance.voice = voiceObj utterance.rate = voiceRate return utterance } var synthesizer = new Speech.Synthesizer() // CHECK FOR SINGLE SELECTED PROJECT OR TASK var sel = document.windows[0].selection var selCount = sel.tasks.length + sel.projects.length if(selCount === 1){ if (sel.tasks.length === 1){ var selectedItem = sel.tasks[0] } else { var selectedItem = sel.projects[0] } } else { throw { name: "Selection Issue", message: "Please select a single project or task." } } // PROMPT USER TO BEGIN DICATATION utterance = createUtterance("Begin Dictation!") utterance.postUtteranceDelay = 0.5 synthesizer.speakUtterance(utterance) // RETURN ID TO SHORTCUT SO OTHER ACTIONS CAN USE IT return selectedItem.id.primaryKey } catch(err){ utterance = createUtterance(err.message) synthesizer.speakUtterance(utterance) throw new Error(-128) } })();

The following script (2 of 2) receives the contents of the previous dictation action and uses it and the passed-in primary key value to locate the selected project or task. The script first prompts the user as to whether to append or replace any existing note text in the selected object.

Append/Replace Note


(async () => { try { function createUtterance(textToSpeak){ AlexID = ( (app.platformName === "macOS") ? "com.apple.speech.synthesis.voice.Alex" : "com.apple.speech.voice.Alex" ) voiceObj = Speech.Voice.withIdentifier(AlexID) voiceRate = 0.4 utterance = new Speech.Utterance(textToSpeak) utterance.voice = voiceObj utterance.rate = voiceRate return utterance } var synthesizer = new Speech.Synthesizer() // CREATE AND DISPLAY FORM var editMethodMenu = new Form.Field.Option( "editMethod", null, ["Replace", "Append"], ["Replace", "Append"], "Replace" ) inputForm = new Form() inputForm.addField(editMethodMenu) formPrompt = "Use dictation to:" utterance = createUtterance("Replace or Append?") synthesizer.speakUtterance(utterance) formObject = await inputForm.show(formPrompt, "Continue") editMethod = formObject.values["editMethod"] // RETRIEVE PASSED ID AND TEXT FROM INPUT (ARGUMENT) passedID = argument.input.objectID dictatedText = argument.input.dictation selectedItem = Task.byIdentifier(passedID) if(!selectedItem){selectedItem = Project.byIdentifier(passedID)} if(editMethod === "Replace"){ selectedItem.note = dictatedText } else { selectedItem.note = selectedItem.note + "\n" + dictatedText } // ANNOUNCE COMPLETION utterance = createUtterance("Done!") synthesizer.speakUtterance(utterance) // RETURN ID TO SHORTCUT SO OTHER ACTIONS CAN USE IT return selectedItem.id.primaryKey } catch(err){ if(!err.message.includes("cancelled")){ utterance = createUtterance(err.message) synthesizer.speakUtterance(utterance) // new Alert(err.name, err.message).show() } } })();

 

 

 

LEGAL

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Mention of third-party websites and products is for informational purposes only and constitutes neither an endorsement nor a recommendation. OMNI-AUTOMATION.COM assumes no responsibility with regard to the selection, performance or use of information or products found at third-party websites. OMNI-AUTOMATION.COM provides this only as a convenience to our users. OMNI-AUTOMATION.COM has not tested the information found on these sites and makes no representations regarding its accuracy or reliability. There are risks inherent in the use of any information or products found on the Internet, and OMNI-AUTOMATION.COM assumes no responsibility in this regard. Please understand that a third-party site is independent from OMNI-AUTOMATION.COM and that OMNI-AUTOMATION.COM has no control over the content on that website. Please contact the vendor for additional information.