|
This document focuses on the
command creation capabilities of the NaturallySpeaking® 7.x
“Professional Products”: Professional, Medical or Legal
This book is for persons learning and using the scripting
functions provided with the ScanSoft Solution Series NaturallySpeaking
Professional 7 products. It progresses from material suitable for a
novice with little scripting knowledge to more advanced topics suited
for programmers and persons with experience with Word, WordPerfect, or
similar scripting languages. It ties together material on Advanced
Scripting so that you don't need to spend as much time searching the
on-line help.
The primary style is one of tackling a problem and
generating a command script step-by-step. Parts of the book contain
notes pertaining to details of the scripting language as it pertains to
NaturallySpeaking.
This document
is ideal for users developing their own
commands, corporate support personnel responsible for command
development, and persons providing services to NaturallySpeaking users.
While most of the detailed information is in the on-line help for Dragon
NaturallySpeaking, this book ties together the concepts and details
needed to produce workable voice commands.
Also available:
Scripting for
Dragon NaturallySpeaking 6
Back to Top of Page
Unabridged Table
of Contents of this book
Contents.
iii
Acknowledgments.
vii
About the Author.
vii
Introduction..
viii
Chapter 1: Introduction to Macros and
Commands.
1
Why Have Custom Commands?.
2
Learn the Dragon NaturallySpeaking®
Commands.
2
Learn Your Word Processor Commands.
3
Learn Keystroke Equivalents.
3
Reading Dragon NaturallySpeaking®-Supplied
Commands.
4
Attributes of Commands.
5
Command Names.
6
Command Descriptions.
7
Command Group.
8
Availability/Scope.
8
Command Type.
10
Content
13
Save/Cancel/Help.
13
Using and Abusing Commands.
13
Training a Command.
14
Command/Macro Viruses.
14
Chapter 2: Text Command Creation..
15
Writing Commands for Repeated Text
15
Inserting Text Via Vocabulary Editor
16
Inserting Text Using Step-by-Step.
18
Inserting Text Using Text and Graphics
Commands.
20
Inserting Text Using Advanced Scripting.
22
How to Name Insertable Text
26
Chapter 3: Control Command Creation..
29
Decide What You Would Like to Do.
29
Record the Steps Taken to Do the Task.
30
Decide How You Will Verbally Express the
Task.
30
Automate the Task.
30
Summary of Steps to Create a Command.
31
Command Example: Sales Tax.
31
Keystrokes, Type Text, or Send Keys.
33
Command Example: Save a Document in a
Directory.
33
Building Commands – Basic Steps.
41
When NOT to Make a Command.
41
Chapter 4: Advanced Scripting..
43
Advanced Command Creation.
43
Example: Date for “Yesterday”
44
Date/Time using Format Statement
46
Example: What Time Is It?.
48
String Operations.
48
Shell Commands.
51
Executing Existing Word Macros.
53
Executing Macros in other MS-Office
Applications.
54
Using the Win32 API (Windows Application
Programming Interface)
55
Win32 API Example: Active Window Title.
56
Win32 API Example: Current Mouse
Position.
56
Libraries of Functions.
58
Using Other Application APIs.
60
Combining Commands.
60
Using Commands with Recorders.
61
Debugging Commands.
62
Common Problems.
64
Caution!
66
Chapter 5: List/Template Commands.
67
Name Editor
67
Example: 3-D Measurements.
68
Name Editor Example – 3-D Measurements.
69
Complex List Applications.
74
Example: Phone List
75
Chapter 6: Dialog (Form) Editor.
77
Dialog Example 1: A Form with Two Text
Boxes.
77
Dialog Example 2: OK/Cancel, Radio
Buttons.
88
Advanced Dialog Functions.
92
Setting Focus.
93
Setting Accelerator (Alt+ ) Keys.
93
Acting Upon a CheckBox.
94
Hiding Fields.
94
Adding Commands for a Form..
94
Chapter 7: Details, Details, Details.
97
Specific Hints by Advanced Scripting
Command Type – Dragon NaturallySpeaking® Extensions,
Alphabetic.
97
AppBringUp.
97
AppSwapWith.
97
Beep.
97
ButtonClick – Click the Specified Mouse
Button.
98
ClearDesktop.
98
ControlPick – Selects a Control (Button,
Prompt, …)
98
DdeExecute - Sends a DDE Command.
98
DdePoke – Sets Value in a DDE
Application.
99
DllCall – Calls a Function in a Windows
DLL.
99
DragToPoint – Drag Mouse to a Point
99
GoToSleep – Put Dragon NaturallySpeaking®
into Sleep Mode.
99
HeardWord.
99
MenuCancel – Cancels the Current Menu.
100
MenuPick – Selects a Menu or Menu Item..
100
Mid – Return Part of a String.
100
MouseGrid – Position Mouse Pointer
101
MsgBoxConfirm..
101
PlaySound.
101
Remember Point – Save Current Mouse
Position.
101
RunScriptFile.
101
SendSystemKeys, SendDragonKeys, and
SendKeys.
102
SetCharFormat - Change Type Font
103
SetMicrophone – Microphone On/Off
104
SetMousePosition – Places Mouse on a
Pixel
104
ShellExecute – Start an Application.
104
TTSPlayString – Generate Synthesized
Speech.
104
Wait – Delay the Script
105
WakeUp – Resumes Recognition.
106
WinHelp – Runs Windows Help.
106
Specific Hints by Advanced Scripting
Command Type – VB and VB Extensions.
106
Special Keystrokes.
106
Producing Special Characters.
106
Clipboard.
107
Date/Time, Now..
107
Debugging.
107
Error Trapping.
108
MsgBox.
108
#Uses.
109
Dragon NaturallySpeaking®
Scripting Language, VB 6, Windows Scripting Host Comparison.
110
Adjusting for Different Keyboards.
110
Using WordPerfect Macros.
111
Using Excel Macros.
111
Chapter 8: Document Production with
Word..
113
Why Do We Use Document Templates, Word
Macros, and Voice Commands?.
113
Creating a New Document Template.
115
Making a Document Template Known to
Dragon NaturallySpeaking®.
117
Command for Navigation Between Fields --
“NEXT”
119
Dates.
121
Insertable Text Within Word.
121
How to Add an Insertable.
122
Insertable Text Hints.
123
Using Insertable Text Without Dragon
NaturallySpeaking®.
123
Numbered Lists.
124
Learning VBA from Word Macros.
125
Basic Word Objects/Constructs.
125
Letterhead.
128
Retaining Documents.
129
Chapter 9: Managing Commands.
131
Naming a Command/Command Template.
131
Training a Command, Renaming a Command.
132
How to Organize Commands.
132
Saving Your Commands.
133
Files Involved with Commands.
133
Sharing Your Commands.
134
Sharing with Others Via Internet
134
Using Multiple Computers – Export/Import
135
Multiple Users in Office – One Computer,
Multiple Users.
136
Chapter 10: To Go Further.
137
Assistance with Visual Basic.
137
Assistance with Microsoft Office.
138
Find Existing Commands.
138
When You Find Commands.
139
Importing Existing Dragon
NaturallySpeaking® Macros.
139
Writing Commands By Voice.
140
Alternatives.
140
For the Future.
140
Appendix A: KEY NAMES..
143
Advanced Scripting SendKeys Mouse
Movement
146
Appendix B: Advanced Scripting vs. VB
Script5 and VBA6.
147
Back to Top of Page
Macros described in this book
Following is a list of commands (macros) described in
Scripting for Dragon NaturallySpeaking 7.
| PAGES |
Command/Macro Name |
| 18-20 |
sample mole removal risks |
| 21 |
sample mole risk insert |
| 22-23 |
sample mole removal surgery |
| 23-26 |
sample mole removal surgery <1to5> |
| |
Note: on Page 26, the text omits the
word "removal" in its examples of what to say |
| 31-33 |
sample open sales tax |
| |
Note: on many systems, the line to
open Calculator will need to change. The example will work on many
Windows-98 and Windows-ME systems without change. Windows-XP users
will find calc.exe in the Windows/system32 directory. |
| 34-40 |
sample save for signature |
| 44-46 |
sample yesterday |
| 46-48 |
sample what time is it |
| 48-50 |
example
save for signature |
| 50-52 |
sample control panel screen saver |
| 50-52 |
sample control panel <applet>
|
| 53-54 |
sample macro one |
| 54-55 |
sample email subjects |
| 55-56 |
sample show window title |
| 56-58 |
sample current mouse position |
| 68-72 |
sample <1to10> by <1to10> by <1to10>
<dimension> |
| 72-74 |
example
<1to10> by <1to10> by <1to10> <dimensionsymbol> |
| 75-76 |
sample phone number <phonelist> |
| 77-88 |
sample two boxes |
| 88-92 |
sample choose format |
| 117-118 |
sample document <name_of_document_template> |
| 121-122 |
sample insert <insertable> |
Back to Top of Page
Sample Pages from this book:
Sample pages
22to25
Sample pages
37to39
Sample pages
79to80
Back to Top of Page
FAQ
(Prepared by author of this resource: Larry Allen):
Question: I have "Scripting for Dragon
NaturallySpeaking 6." Should I buy this book?
Answer: It depends on your needs.
Material was added or changed to cover the following topics: producing
date/time using "format" statements, added material on Word macros, an
Excel example, a "current mouse position" script as an additional Win32
API example, more commentary on using features of dialog boxes, and
commentary on using #Uses for a library of functions. There was not a
fundamental change in scripting between Release 6 and Release 7.
Question: I don't know what a script is
and I've never programmed before. Will I be able to understand this
material?
Answer: Yes, so long as you
understand how to construct detailed instructions to complete a task.
This book was written for and has been used by many doctors, lawyers,
and other professionals.
Question: I have two good hands. It
seems that voice commands are only needed for people who are using
Dragon NaturallySpeaking because they cannot use a keyboard. Why should
I consider learning to write such commands?
Answer: Voice commands can save
time -- lots of time -- if you need to do repetitive tasks using your
computer. That can be repetitive text, repetitive documents, repetitive
look-ups, repetitive spreadsheets, repetitive e-mail, ... Automation is
the key.
Question: I am a full-time
programmer and wish to voice-automate my program. Will this book assist
me?
Answer: It will include some
details that are either not available elsewhere or are hidden in various
documents. But it will not directly assist in integrating
NaturallySpeaking with your program as it does not concentrate on the
events and objects used to voice-automate proprietary programs by
vendors. Softnet Systems can provide assistance on such tasks as part of
its consulting business.
Back to Top of Page
Corrections to Scripting for Dragon NaturallySpeaking 7:
1. Index entries between pages 87 and 95 are off by
one page (e.g. if Index says page 90, the material is actually on page
89). Index entries for pages 97-156 are off by two pages. (Thanks, Don!)
2. The Win32 API Example --
Current Mouse Position in the macro on pages 55-58 returns a mouse
position relative to the top left of the active window, not a position
relative to the upper left of the client area of the active window. The
line:
clip = "SetMousePosition 5," & result.x & _
should be:
clip = "SetMousePosition 1," & result.x & _
That is, the "5" should be a "1"
|