Creating Voice Commands
Text Macro Writing
One can say "create new command," or use the Dragon bar menu Tools > Add New Command. The new command wizard will deploy. To write a global text macro select existing text on the screen and say "Make That a Shortcut." This will open the new command tool and copy the selected text into the content portion of the command tool. Alternatively Once the tool has deployed there are four basic steps to writing a global text macro:
- Write a command phrase to launch the Text macro. It should be two or three words and not sound like a common phrase to prevent unintended launches.
- Enter text content to be deployed when the command phrase is recognized. (If the "Make That a Shortcut" command was used the text should reappear in the Content window).
- Check the Plain Text checkbox -this will allow the text macro to take on the target attributes when launched (ie., if the text environment is Times New Roman 10 the text will appear in that font and size).
- Click the Save Control.
Text Macro Writing with Text Variables
One can say "create new command," or use the Dragon bar menu Tools/Add New Command. The new command wizard will deploy. To write a global text macro select existing text on the screen and say "Make That a Shortcut." This will open the new command tool and copy the selected text into the content portion of the command tool. Alternatively Once the tool has deployed there are four basic steps to writing a global text macro:
- Write a command phrase to launch the Text macro. It should be two or three words and not sound like a common phrase to prevent unintended launches.
- Enter text content to be deployed when the command phrase is recognized. (If the "Make That a Shortcut" command was used the text should reappear in the Content window). Locate the insert point wherever you need a text variable to appear, and activate the Variable Control
- Check the Plain Text checkbox -this will allow the text macro to take on the target attributes when launched (ie., if the text environment is Times New Roman 10 the text will appear in that font and size).
- Click the Save Control.

Step-By-Step Macro Writing
These are used for activating screen controls like "Find New Patient" and writing voice commands to call the 'quick text' functions of Electronic Medical Records (EMR To write a Step-By-Step macro:
One can say "Create new command," or use the Dragon bar menu Tools/Add New Command. The new command wizard will deploy.
- On the MyCommand Name line enter the phrase that will be used
to launch the new command. Try to make it two or three words
in length; intuitively named; and distinct from normal language-
many people use a separator word like 'macro' or 'text' in the
command name, or "dot" if it launches a 'dot phrase'.

- Change the command type to "Step-by-Step."

- Set the first command step to "Type Text”.
- After executing the Insert control (to the right of the Type
Text in the New Step box) a dialogue called Type Text Step will
appear. Type the literal dot phrase into the ‘Specify the
text to be typed:’ field and activate the Okay control.
- Change the New Step to Keystroke and activate the Insert
Control. When the key capture window appears hit the Enter key to
capture this as the next step. As long as the command window looks
like the example below use the Save control and you will have
created a voice command that will launch the dot phrase.
.
Additional Info: The Send Keys Object
Use the Send Keys Step dialog box to enter a sequence of keys (including CTRL, ALT, and SHIFT key sequences) that you want to be part of your command.
You can create a key sequence by either its keyboard representation, (such as "a," "b," "c," etc.) or through non-printing keys enclosed in curly braces "{}." Click the following button to view a table of reserved words:
The key in a key combination is preceeded by one or more of the following reserved characters:
- SHIFT: + (plus sign)
- CTRL: ^ (caret)
- ALT: % (percent sign)
Examples
- {CTRL+V} is ^V
- {SHIFT+TAB} is +{TAB}
- {ALT+DOWN} is %{DOWN}
| Key | Reserved word |
|---|---|
| BACKSPACE | {BACKSPACE} or {BS} |
| BREAK | {BREAK} |
| CAPS LOCK | {CAPSLOCK} |
| SCROLL LOCK | {SCROLLLOCK} |
| LEFT ARROW | {LEFT} |
| RIGHT ARROW | {RIGHT} |
| UP ARROW | {UP} |
| DOWN ARROW | {DOWN} |
| DELETE or DEL | {DELETE} or {DEL} |
| INSERT | {INSERT} |
| HOME | {HOME} |
| END | {END} |
| PAGE UP | {PGUP} |
| PAGE DOWN | {PGDN} |
| RETURN | {RETURN} |
| ENTER | {ENTER} |
| ESC | {ESCAPE} or {ESC} |
| HELP | {HELP} |
| TAB | {TAB} |
| F1-F24 | {F1} through {F24} |
| NUMPAD0 | {NUMPAD0} or {NP0} |
| NUMPAD1 | {NUMPAD1} or {NP1} |
| NUMPAD2 | {NUMPAD2} or {NP2} |
| NUMPAD3 | {NUMPAD3} or {NP3} |
| NUMPAD4 | {NUMPAD4} or {NP4} |
| NUMPAD5 | {NUMPAD5} or {NP5} |
| NUMPAD6 | {NUMPAD6} or {NP6} |
| NUMPAD7 | {NUMPAD7} or {NP7} |
| NUMPAD8 | {NUMPAD8} or {NP8} |
| NUMPAD9 | {NUMPAD9} or {NP9} |
| ADD | {ADD} |
| SUBTRACT | {SUBTRACT} |
| MULTIPLY | {MULTIPLY} |
| DIVIDE | {DIVIDE} |
| DECIMAL | {DECIMAL} |
| SEPARATOR | {SEPARATOR} |
| SPACE | {SPACE} |
| SELECT | {SELECT} |
| {PRINT} | |
| EXECUTE | {EXECUTE} or {EXEC} |
| SNAPSHOT | {SNAPSHOT} |
| CANCEL | {CANCEL} |
| WINDOWS | {WINDOWS} or {WIN} |
| APPLICATIONS | {APPLICATIONS} or {APPS} |
| LBUTTON | {LBUTTON} or {LBTN} |
| RBUTTON | {RBUTTON} or {RBTN} |
| MBUTTON | {MBUTTON} or {MBTN} |
| CLEAR | {CLEAR} |
Notes
- You can have a key sequence repeat by adding a number indicating the number of times you want to repeat that sequence. For example, to have the return key pressed five times, enter {RETURN 5} (be sure to include a space between the key name and the number).
- If you experience inconsistent results with a Step-by-Step command, try adding Wait steps of 100 milliseconds between each keyboard action.
Match Destination Formatting
To write a macro to use the "Match Destination Formatting" tool in Microsoft Word create a command using the Step-by-Step keystroke tool:
- Put in the command name "Match Destination Formatting"
- Change the Command Type to Step-by-Step
- By default the New Step control will show Keystrokes. Click the Insert control or use Alt+R to activate. This will deploy a simple key capture window. Press the keys Alt+Shift+F10 (the hot key associated with activating a Smart Tag). Activate the Okay control. Reactivate the Insert control and press the "D" key on the keyboard, followed by the Okay control.
- Use the Save control.

When a Smart Tag appears the command Match Destination Formatting will complete the execution of this function in the Smart Tag.
Go to Work Orders
The following step-by-step script can be used in Outlook 2003 to put focus on a specific folder. It can also be written as a variable macro which would allow the use of a list to reference the specific folder name.
- With the MyCommands Editor in Step-by-Step mode, type in, "Go To Work Orders" in the MyCommand Name field.
- Into the Steps field type or cut and paste the following:
Send Keys "^y" Send Keys "%f" Type "WORKORDERS" Wait 50 milliseconds Send Keys "{Enter}" - Press the save button to save your command and close the editor.

Advanced Scripting Macros
The first Advanced Scripting macro comes from the examples available in the Dragon Pro Command Browser.

' This command shows how to refer to variables. If you
' say, for example, "sample script three elephants" it
' types the word "elephant" three times.
' 1to10 is an existing variable used in many built-in
' commands. samplelist is a variable created just
' for this command.
' UtilityProvider.ContextValue(0) contains the value
' spoken in place of 1to10.
' UtilityProvider.ContextValue(1) contains the value
' spoken in place of samplelist.
Option Explicit
Dim i As Integer
Dim j As Integer
Sub Main
j = str2int(UtilityProvider.ContextValue (0))
For i = 1 To j
SendDragonKeys " " + UtilityProvider.ContextValue(1)
SendDragonKeys "{Backspace}" 'to remove the s
Next i
End Sub
Function str2int (num As String )
Select Case num
Case "one"
str2int = 1
Case "two"
str2int = 2
Case "three"
str2int = 3
Case "four"
str2int = 4
Case "five"
str2int = 5
Case "six"
str2int = 6
Case "seven"
str2int = 7
Case "eight"
str2int = 8
Case "nine"
str2int = 9
Case "ten"
str2int = 10
End Select
End Function
Outlook Calendar Macro
This is an example of advanced scripting using a double variable that would allow the user to put in both month and date with a single command to search through the calendaring system in Microsoft Outlook. It allows voice activated date dictation in the Outlook Calendar view.
Type or cut and paste the following into the Script field of the MyCommand Editor in Advanced Scripting mode:
Sub Main
SendDragonKeys"{Ctrl+g}"
If ListVar1= "January" Then SendDragonKeys"01/"
If ListVar1= "February" Then SendDragonKeys"02/"
If ListVar1= "March" Then SendDragonKeys"03/"
If ListVar1= "April" Then SendDragonKeys"04/"
If ListVar1= "May" Then SendDragonKeys"05/"
If ListVar1= "June" Then SendDragonKeys"06/"
If ListVar1= "July" Then SendDragonKeys"07/"
If ListVar1= "August" Then SendDragonKeys"08/"
If ListVar1= "September" Then SendDragonKeys"09/"
If ListVar1= "October" Then SendDragonKeys"10/"
If ListVar1= "November" Then SendDragonKeys"11/"
If ListVar1= "December" Then SendDragonKeys"12/"
SendDragonKeys"{" & ListVar2 & "}"
SendDragonKeys"{Enter}"
End Sub
Copyright 1999- 2009 Next Generation Technologies Incorporated