View Full Version : Dragon NaturallySpeaking Scripting
Rogrand
12-13-2016, 01:30 PM
Useing ECW that has ability to create macros using scripting. I need a script that would find a string and have it open it by clicking on it. It prompts you for:
sub main
End sub
Don't know how to script to do this. Any help will be appreciated. See screen shot of links it needs to find (in purple) on the left and on the right a window to create the script.
Moderator Note: Read at least Post # 9 before replying
I can't find online any references to an answer searching for: "ECW (electronic clinical works) macro scripting language"
You might try registering at the Users Group Forums
http://ecwusers.com/
If you have the Documentation that came with the unit, it should have something about scripting.
Rogrand
12-13-2016, 07:25 PM
My apologies. It will effect ECW but macro is being run dragon naturally speaking.
General Search link for dragon naturallyspeaking macro script language
https://duckduckgo.com/?q=dragon+naturallyspeaking+macro+script+language&atb=v19&ia=web
Dragon NaturallySpeaking Forum
http://knowbrainer.com/forums/forum/categories.cfm?catid=12
General youtube search
https://www.youtube.com/results?search_query=Dragon+NaturallySpeaking+Macros+
NaturallySpeaking Tutorial PDF
https://www.youtube.com/results?search_query=Dragon+NaturallySpeaking+Macros+
HowTo and Language Reference
http://www.speechrecsolutions.com/assets/VoiceCmd.pdf
Most important knowledge For the How To PDF
Chapter 1 Introduction to Voice Commands
This chapter provides a description of voice commands and their
elements. It includes the following topics:
· Voice commands
· Scripting language
Voice Commands
A Dragon NaturallySpeaking voice command is a word or phrase that
causes Dragon NaturallySpeaking to take some action other than type
the text you just spoke. Voice commands that you create are sometimes
called macros. Each voice command has three elements:
· name
· action
· scope
Voice Command Name
The voice command name is the word or phrase that you say to run the
voice command, such as:
What Can I Say
You say the phrase “What Can I Say” to run the voice command.
A voice command name can include the names of one or more lists of
words. Dragon NaturallySpeaking recognizes any command that
matches the words in the command name and a word (or phrase) from
each list. For example, when you use the command:
Set Font <FontFace>
you say the words “Set Font” followed by a word from the FontFace
list, such as “Arial”. The full spoken command can be “Set Font Arial”,
or “Set Font Times New Roman”, and so on.
Voice command names should consist of two or more words. This
makes for a more natural command set and limits confusion with
dictation words.
Scripting Language
The Dragon NaturallySpeaking scripting language is the programming
language for Dragon NaturallySpeaking voice commands. It provides a
set of commands that Dragon NaturallySpeaking can interpret and
execute. It also provides a set of standard program elements such as data
manipulation functions and flow control statements.
A script is a sequence of scripting commands and program elements. A
script automates a task that controls Dragon NaturallySpeaking and
Windows. Many Dragon NaturallySpeaking commands run scripts.
The scripting language supports the following elements:
· Expressions
· Variables
· Operators
· Data manipulation functions
· Flow control statements
· Scripting commands
The scripting language expressions, variables, operators, data
manipulation functions, and flow control statements are modeled after
the BASIC computer language. They provide the programming
language framework for writing powerful voice command scripts.
Scripting Command Overview
Dragon NaturallySpeaking scripting commands provide you with a
powerful set of tools for controlling Dragon NaturallySpeaking, the
Windows environment, and your applications. With them, a voice
command script can:
· Launch and control applications on the desktop, including changing
the active application.
· Control applications by using DDE commands and DLL calls,
sending keystrokes to an application, selecting a window control,
and selecting a menu item.
· Control Dragon NaturallySpeaking by putting it into and out of
sleep mode and turning the microphone on and off.
· Control script execution by displaying a confirmation box, running
another voice command script, and making the script pause.
· Control the mouse, including clicking the mouse buttons, dragging
the mouse, controlling mouse motion, and controlling the
MouseGrid™.
· Tell Dragon NaturallySpeaking to behave as if it recognized a
specific word or set of words.
· Play beeps and .wav files.
· Control dictated text by sending keystrokes to the active window and
“pressing” modifier keys such as Shift, Alt, and Ctrl.
You can build powerful voice commands by combining these
operations.
When you "Grok" all that, you can look at
Chapter 5 Scripting Language Reference
I am Changing the Thread Title to indicate that this is about Dragon NaturallySpeaking so our experts can see that.
The problem we have is that you don't even know enough to know how to ask a question. That is where I am trying to lead you.
A Script is very much like a Decision tree or Diagnostic chart. It must be planned the same way. The planning starts with a simple question
How do I find this(thing) and do something with it? I see that you want to "open a String." That is impossible, You can't Open a String of Characters. You can edit them rearrange them, print them, copy them etc. A String is just 1 or more keyboard characters. I suspect that the "String" you are interested in is the Name, ID, or Index of an Object.
I suspect that those "Links it needs to find" are actually Objects in the ECW system. As an example, some Excel Objects are Workbooks, Worksheets, Rows, Columns, Cells, and Fonts, Cell Interiors, Cell Comments, Borders, and even some Names. Some Names are Properties. The Value of a Worksheet.Name is a String.
Variables are often compared to envelopes that hold values. In VBA we Declare variables with the Dim Statement.
A simple script to show a worksheet.
Sub A()
Dim X as String
X = "Sheet1"
Sheets(X).Activate
End Sub
X is a Variable, a String variable. It can hold nothing but Strings
Sheets is an Object, a Collection Object. Sheets specifically "collects" all Sheets in a Workbook. The Indices of the Sheets Object are Strings, the Names of the Sheets in a Workbook.
This concludes the lecture on Object Oriented Programming. There will be a test.
Before writing a script, or any code, you must have an algorithm. An algorithm is a word picture of what the script has to do.
Start with a simple question: How do I turn Sheet Tabs red if that Sheets Range("B3") is larger than 42?
The algorithm:
Look at each sheet
Compare Range("B") to 42
IF it is LARGER than 42 THEN
Turn that sheet tab red
Declare a routine, or Script, or Sub
Sub RedTabs()
'(I see that) we need a variable to hold each sheet while we work with it.
Dim Sht As WorkSheet
For Each Sht in Sheets 'look at each sheet
If Sht.Range("B3") > 42 Then
Sht.Tab.Color = Red 'Tab is an Object and Color is a Property
Next 'Look at the next Sheet in the Collection.
End Sub.
The beauty of a Basic Language like VBA or NaturallySpeaking is that the actual code very closely resembles the algorithm. The problem is that you must first understand enough to ask a suitable Simple Question.
I await your return in a few days.
Rogrand
12-14-2016, 06:33 AM
Hello Mark, I get syntx error message. I believe its because of the "sheet" in the vba since its not an excel document.
Rogrand
12-14-2016, 06:38 AM
Hello Sam, From the example above, the script refers to a worksheet and its not. The team went through dragon training but it does not include using scripting language. In this case, for dragon to understand what I am asking it to do, it would need a script that will find a key word in the active window of the application and launch it as if I manually clicked on thus word. See attachment. Thanks for the help,.
Mark007 wrote the PHP script that drives the # icon in the Post Editor menu bar. # inserts Code Tags into your Post and formats any text between the tags when you submit the Post.
From the example above, the script refers to a worksheet
What did you expect after all that verbiage?
Somebody has to learn the DNS scripting language.
That somebody is you. (Unless we happen to have a member that already speaks it.)
I can help you learn general Basic syntax and structure, and how to think like a programmer, but I am not equipped to teach DNS.
I suggest that you download and print the PDF's linked to above and distribute them to the team. I bet someone on the team has an innate talent for this. You and the team can get a feel for general scripting just by browsing our forums and looking at threads with many replies.
See Again: Post #4 above
Rogrand
12-14-2016, 12:30 PM
According to the DNS training, it will work with basic language. I just not konwlege to know the verbiage. Starting with the Sub Main what would be the verbiage to search for a string then activate it as if I where to hover my mouse and click on it. "social History" for example.
The DNS verbiage is in the How To pdf link
However, just as when working with VBA and Excel, I have to know VBA verbiage and Excel verbiage, you must also know some ECW verbiage.
Rogrand
12-15-2016, 07:00 AM
Hello Sam, I am here because you are the expert. Having said this, Just thought that there were generic scripting I could have tried. Thank you for the time and effort you and others spent on my novice question. Happy Holidays!
Didn't knowbrainer.com have anything?
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.