KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Scripting "Manual" or other reference?
Topic Summary: Is information on writing scripts collected for reference somewhere?
Created On: 02/28/2012 06:51 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Scripting "Manual" or other reference?   - britechguy - 02/28/2012 06:51 PM  
 Scripting "Manual" or other reference?   - R. Wilke - 02/29/2012 04:03 PM  
 Scripting "Manual" or other reference?   - Jomark - 02/29/2012 05:23 PM  
 Scripting "Manual" or other reference?   - R. Wilke - 02/29/2012 05:30 PM  
 Scripting "Manual" or other reference?   - britechguy - 02/29/2012 05:37 PM  
 Scripting "Manual" or other reference?   - R. Wilke - 02/29/2012 05:54 PM  
 Scripting "Manual" or other reference?   - R. Wilke - 02/29/2012 06:07 PM  
 Scripting "Manual" or other reference?   - Jomark - 03/01/2012 03:51 AM  
 Scripting "Manual" or other reference?   - Lunis Orcutt - 03/01/2012 07:54 PM  
 Scripting "Manual" or other reference?   - mhaines94108 - 07/15/2012 09:26 AM  
 Scripting "Manual" or other reference?   - artsilen - 01/03/2013 08:07 PM  
 Scripting "Manual" or other reference?   - Alan Cantor - 01/03/2013 10:07 PM  
 Scripting "Manual" or other reference?   - artsilen - 01/04/2013 01:58 PM  
 Scripting "Manual" or other reference?   - Chucker - 01/04/2013 02:51 PM  
Keyword
 02/28/2012 06:51 PM
User is offline View Users Profile Print this message


britechguy
Junior Member

Posts: 6
Joined: 11/13/2011

Hello,

         I have been working with a client for several months now with DNS 11.5 Premium and we have recently added KnowBrainer into the mix.  He has low vision and severe cerebral palsy so he has no functional use of his hands.   We have achieved pretty amazing recognition with DNS after significant training (of DNS, not the client, who has a long history with earlier versions).

         The client's breath support is erratic, so many commands that are multi-word, e.g., "Insert after <word> <character|word|phrase>," are well nigh impossible for him to get out with sufficient fluidity for DNS to recognize them correctly.   However, if I could change the word, "Insert" to "Put" or the phrase "Insert after" to a coined phrase like "Put Aft", I think a far better result could be had.

         So far I have not been successful in locating any reference I could use to look at existing/example scripts or a comprehensive list of the scripting commands available, where/how "the word the person said" is inserted into the script, etc.   Does such a thing, or do several such things, exist anywhere?

         Thanks in advance for any assistance anyone can offer.

 Brian



-------------------------
DNS Naturally Speaking 11.5/Dragon Dictate 2.5 for Mac
 02/29/2012 04:03 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 5163
Joined: 03/04/2007

What you are thinking of is not doable, and there is no such manual which you are asking for. These commands are hard-coded into Dragon and there is no way of changing them. To some degree, there are ways of mimicing the behavior of certain types of commands, and there are even ways of making it easier for the person you are working with to accomplish that particular task, but it takes having the professional version of Dragon to do this, considering the enhanced functionality being required in here.

Rüdiger

 



-------------------------

 02/29/2012 05:23 PM
User is offline View Users Profile Print this message


Jomark
Top-Tier Member

Posts: 1334
Joined: 10/19/2006

Rüdiger

He has KnowBrainer so it would be a possibility would it not to create some or all of the commands to achieve the desired results.



-------------------------
Jomark
 02/29/2012 05:30 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 5163
Joined: 03/04/2007

Jomark,

I don't think so. But anyone might try. What I am thinking of is splitting the command in two pieces, bringing up an input box for the user to insert the word or the phrase he wants the cursor relocated relatively to, giving him all the time he needs for it, and after confirming the box mimicing an "insert before/after word(s)" command to be executed. That would involve various ingredients being available in the very powerful Advanced Scripting technology, such as variables, data types, methods to handle them, etc., not forgetting interface referencing, which I don't think are around in KnowBrainer as far as I can tell.

Knowing that HeardWord is around in KnowBrainer also, like I said, anyone might try.

Rüdiger

 



-------------------------

 02/29/2012 05:37 PM
User is offline View Users Profile Print this message


britechguy
Junior Member

Posts: 6
Joined: 11/13/2011

Uh, it would be news to me if KnowBrainer had removed the scripting capability (and I know they haven't).

It is possible to create elaborate scripts to do a DNS command or sequence of DNS commands with a single KB voice command that triggers the script.   It's also possible to create certain custom commands in DNS Premium, but that capability is somewhat limited.

I used to be a programmer, so the concept of scripting under MS-DOS, the various Windows flavors, and various Unix flavors is very familiar to me.  What I can't seem to find is a reference to the scripting language in KB and its syntax.   Starting out I'd only create a few relatively simple scripts that would likely be alternate invocations of DNS native commands.  KB already does this with "Beginning" for DNS "Go to Top", "Bottom" for DNS "Go to bottom", and there are more.

Brian



-------------------------
DNS Naturally Speaking 11.5/Dragon Dictate 2.5 for Mac
 02/29/2012 05:54 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 5163
Joined: 03/04/2007

Quote:
What I can't seem to find is a reference to the scripting language in KB and its syntax.

What you see in the KnowBrainer commands editor is what you get. Basically it boils down to having access to a range of legacy DVC scripting functionality, which I think you should be able to look up in the help files somewhere.

What I have described above doesn't seem to be doable from there. Besides, the problem you will be facing when trying to redesign the behavior of the "insert" commands in Dragon, no matter which way you choose, will be catching continuous input and determining the varying parts in it, due to Dragon being restricted to a pause before and after a command being required to determine the command from the start, except for listing commands with fixed list elements, with no pause before the list elements being inserted.

Rüdiger

 



-------------------------

 02/29/2012 06:07 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 5163
Joined: 03/04/2007

Oops, now you got me thinking, and after recovering from a major Alzheimer's attack obviously, there is way to accomplish what you have been asking for, but it has never been documented, and although, when I discovered it at around in March 2009 I asked Lunis to update his Quick Tips, he never did.

The approach however is in following an entirely different path. Indeed, there are a few, however rather limited built-in commands that can be changed by the user. To do this, please insert the following lines to your options.ini file (in the current profile):

enx Insert Before XYZ Command=My Insert Before %1
enx Insert After XYZ Command=My Insert After %1

After doing so, reload the profile and then, the "Insert Before" command will be "My Insert Before". This way, you can also shorten the commands any way you like, I would suggest something shorter but unique rather, such as "infor" and "inafter". Get the idea?

Rüdiger

 



-------------------------

 03/01/2012 03:51 AM
User is offline View Users Profile Print this message


Jomark
Top-Tier Member

Posts: 1334
Joined: 10/19/2006

Quote:
What I can't seem to find is a reference to the scripting language in KB and its syntax

The KB Verbal Basic manual might be of assistance to you.

You might also consider Larry Allen's book "Scripting for Dragon Naturally Speaking"



-------------------------
Jomark
 03/01/2012 07:54 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 25389
Joined: 10/01/2006

If you're using KnowBrainer 2011 you can say How Do I Write Commands or click VerbalBasic Manual to download the PDF manual. If you prefer to script within DNS Pro, Larry Allen’s Scripting for Dragon NaturallySpeaking 11 is the Gold Standard.

-------------------------


Click KB 2012 REV D to Download a 30 Day Evaluation of KnowBrainer 2012
Click SpeechStart+ to Download a 15 Day Evaluation of SpeechStart+

 07/15/2012 09:26 AM
User is offline View Users Profile Print this message


mhaines94108
Junior Member

Posts: 39
Joined: 12/06/2010

I am going to modify my previous remark.

I bought Larry Allen's manual. The initial chapters seem to be written for someone with no programming experience, but chapters 7 and following are both an excellent reference and discuss a lot of "how to" techniques. I'm going to give it a tentative recommend. I say tentative because I have yet to write a serious script.
 01/03/2013 08:07 PM
User is offline View Users Profile Print this message

Author Icon
artsilen
Top-Tier Member

Posts: 287
Joined: 12/11/2008

Over the holiday break I attempted to write a few scripts using Larry Allen's manual and the VerbalBasic manual. Not being a programmer, I seemed to be getting nowhere, despite the step-by-step instructions in the manual and on the website. I got to the point where I stopped getting error messages, but instead, I got text renditions of the programming instructions. This was simple stuff; centering text on the page, and justifying the margins. Basically, I copied the format used in the other KnowBrainer commands, SendKeys "{Ctrl+e}", and SendKeys "{Ctrl+e}". I then refreshed KnowBrainer, opened DragonPad, and then try to see if this tanker trailer would actually work. Not a chance! There seems to be an existing command, "Center That" (which I hadn't known about); but that wasn't the point. I was trying to find out what the syntax should be, and I seem to be getting nowhere. That was driven home to me when the next command to justify the text string in the test document I was creating repeated in the blue dictation box, but otherwise nothing happened.

Several questions -
(i) How do I differentiate between the command string SendSystemKeys and SendKeys?
(ii) The programming syntax in Larry Allen's book, seems inappropriate to writing command scripts in KnowBrainer, which is okay.
(iii) it's unclear whether the new commands require blank spaces between the keystroke switch (Shift, Control, Alternate, the "+" and the command word/letter itself. On the printed page, it appears to be an unbroken string of text.

When I went into Microsoft Word, and vocalized those commands, one I got, instead, were text strings with the commands themselves, as if I were dictating strings of text. Not a good way to start off the new year... I was also getting oddball results from other commands that I was dictating to open and close files, etc. Holding down the Control key did not help.

This is odd, because on one hand, KnowBrainer clearly allows me to write new commands within KnowBrainer that presumably will be reflected in changes on the page in Microsoft Word, or so it seems. So far, I've gotten nowhere fast; and since other people seem to be doing things correctly, the error seems to have to be with me.

What am I doing wrong, and how do I fix it?

-------------------------

Art Silen

artsilen@sbcglobal.net



"Question assumptions"


DSN 11.5, running on Win7;Intel Core i7 CPU 970 @3.20 GHz; System Memory 12 GB; Graphic AMD Radcon HD6570; System Board 2A861.04E01; System Bios 6.15

 01/03/2013 10:07 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 1917
Joined: 12/08/2007

The syntax for SendKeys and SendSystemKeys is different. It takes time (and lots of trial-and-error experimentation) to get everything right when one is starting out with scripting.

For example, these two statements both press Alt + A...

SendSystemKeys "{Alt+a}"

SendKeys "%a"

Note that SendSystemKeys is "{Alt+a}", not "{Alt+A}", which is equivalent to Alt + Shift + a.

In some contexts, the SendKeys command is unreliable. But when it works, it works well.

When learning to script, there is no substitute for the experience of writing code that does not work, spending hours trying of figure out why, getting frustrated beyond words, and having the a-ha! moment that solves the problem.

Show us the code you have written, and perhaps someone will spot the problem.

Keep on persevering!
 01/04/2013 01:58 PM
User is offline View Users Profile Print this message

Author Icon
artsilen
Top-Tier Member

Posts: 287
Joined: 12/11/2008

Wow! Thank you, Alan.

I'm all for trial and error, but it would be helpful to have some basic "rules of the road" about syntax and punctuation.

Where can I find that?

-------------------------

Art Silen

artsilen@sbcglobal.net



"Question assumptions"


DSN 11.5, running on Win7;Intel Core i7 CPU 970 @3.20 GHz; System Memory 12 GB; Graphic AMD Radcon HD6570; System Board 2A861.04E01; System Bios 6.15

 01/04/2013 02:51 PM
User is online View Users Profile Print this message

Author Icon
Chucker
Top-Tier Member

Posts: 11037
Joined: 10/10/2006

Art,

Some of what you're looking for is in the Dragon Help. Try searching the Dragon Help for SendKeys, SendSystemKeys, and SendDragonKeys. Regardless of whether using Advanced Scripting or KnowBrainer, the syntax for these are the same. Besides, reviewing what's available in the Dragon Help will go a long way towards understanding how to write commands.

Chuck

A little bit of knowledge is dangerous, a lot of knowledge is just plain fatal. - Chuck Runquist

-------------------------

Statistics
28386 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 6 users logged in.
The most users ever online was 2028 on 04/05/2013 at 07:36 PM.
There are currently 97 guests browsing this forum, which makes a total of 103 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2014 FuseTalk™ Inc. All rights reserved.