KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Building a List at Runtime
Topic Summary: Is it possible to build a list at runtime?
Created On: 01/01/2012 02:35 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Building a List at Runtime   - Sparky007 - 01/01/2012 02:35 PM  
 Building a List at Runtime   - Larry Allen - 01/05/2012 08:29 AM  
 Building a List at Runtime   - R. Wilke - 01/05/2012 08:43 AM  
 Building a List at Runtime   - monkey8 - 01/05/2012 09:30 AM  
 Building a List at Runtime   - monkey8 - 01/05/2012 10:46 AM  
 Building a List at Runtime   - Sparky007 - 01/06/2012 04:06 AM  
 Building a List at Runtime   - bk82 - 01/12/2012 05:34 PM  
 Building a List at Runtime   - mdl - 03/17/2012 01:46 AM  
Keyword
 01/01/2012 02:35 PM
User is offline View Users Profile Print this message


Sparky007
Junior Member

Posts: 6
Joined: 08/21/2010

Hello,

I was wondering if it is possible to build lists at run time using Dragon naturally speaking scripts?

The reason being I have a script which is called by saying the following 2 words:

IntelliSense <category>

This script opens a database and lists all the available SendKeys statements for the category spoken.

The problem is I'm constantly adding new categories and therefore I'm having to manually edit the script each time.

Please find the script attached in XML format.

It's not the end of the world if this can't be done but it would be nice…

Many thanks for your time and patience.

Mark Phillipson






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

 

http://mphillipson.users.btopenworld.com/index.htm

 01/05/2012 08:29 AM
User is offline View Users Profile Print this message


Larry Allen
Advanced Member

Posts: 181
Joined: 09/04/2007

No, as a practical matter.

I saw a partial script at least 2 years ago which walked through all the manual steps, but it ended up taking several seconds to add an element to a list so it wasn't very practical but might have use where hands-free usage was more important than time.  e.g. it had a dialog box to define the list element, then closed the dialog, opened Command Browser, went to the Script tab, found the script with the list, opened it, went to the Name Editor, picked the list, did "Edit", added to the list, closed windows.  It was posted on one of the Internet groups discussing Dragon.   As I recall, there was a common error that caused this script to fail at least some of the time.   Or perhaps I just wish I had seen such a script.   If it had worked well, I know several of us would have adopted it for our own use!

 



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

Larry Allen
Softnet Systems, Inc.
http://www.pcspeak.com

 01/05/2012 08:43 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 4391
Joined: 03/04/2007

Larry,

being in the mood for throwing ideas ...

How about trying this with an export of the command in XML format? - Not that I even touched it, but it just sprang to mind here.

Rüdiger

 



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

Well, it's past the point where we can make any changes in the code, but we can still make changes to the Easter Egg!

 01/05/2012 09:30 AM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 1987
Joined: 01/14/2008

Quote:
saw a partial script at least 2 years ago which walked through all the manual steps, but it ended up taking several seconds to add an element to a list so it wasn't very practical but might have use where hands-free usage was more important than time. e.g. it had a dialog box to define the list element, then closed the dialog, opened Command Browser, went to the Script tab, found the script with the list, opened it, went to the Name Editor, picked the list, did "Edit", added to the list, closed windows. It was posted on one of the Internet groups discussing Dragon. As I recall, there was a common error that caused this script to fail at least some of the time. Or perhaps I just wish I had seen such a script. If it had worked well, I know several of us would have adopted it for our own use!


You don't need to open a valid script to edit or add a list. You can open an empty command dialogue, go straight to the lists, edit the list or add a list and then okay it a couple of times and then cancel the command dialogue without saving any command. The list will be saved. So for example the following very basic command runs very quickly, called:

edit <lists> list

will allow you to directly edit any valid list which is contained in <lists>, note it doesn't call any command but simply directly accesses the list using the commands editor. We did this for Mike Crowe last year.

Sub Main
 Dim EngineControl As New DgnEngineControl
 EngineControl.DlgShow(dgndlgNewCommandWizard, 0, , 0)
 Wait 1
 SendKeys"%m"
 Wait 0.5
 SendKeys "<" & ListVar1 & ">"
 Wait 0.1
 SendKeys"{Tab 2}"
 Wait 0.1
 SendKeys" "
 Wait 0.1
 SendKeys"%e"
 Wait 0.1
 SendKeys"^{End}"
End Sub

The other way to do it:

1)  is edit the MyCmds.dat directly, not easy because it's partially encoded but we do it with ScriptManager.

2) create a new .dat file with one command and your list and directly import it with the engine control's ImportMyCommands

3) similar to 2 but using an XML file as suggested by Rüdiger.

Lindsay



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


www.pcbyvoice.com
www.pcbyvoice.co.uk

 01/05/2012 10:46 AM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 1987
Joined: 01/14/2008

To answer the question more directly you can add a list as follows. This will add a list called <myNamesList> with the following content:

Larry
Rüdiger
Lindsay
Lunis

Takes only a couple of seconds and you may be able to shorten the waits

Sub Main
 Dim EngineControl As New DgnEngineControl
 EngineControl.DlgShow(dgndlgNewCommandWizard, 0, , 0)
 Wait 1
 SendKeys"%m"
 Wait 0.5
 SendKeys"%i", True
 SendKeys"^a", True
 SendKeys"myNamesList", True
 SendKeys"%c", True
 SendKeys"Larry~Rüdiger~Lindsay~Lunis", True
 SendKeys"{Tab}~", True
 SendKeys"~", True
 ControlPick"Cancel"
 Wait 0.1
 SendKeys"%y"
End Sub

Lindsay



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


www.pcbyvoice.com
www.pcbyvoice.co.uk

 01/06/2012 04:06 AM
User is offline View Users Profile Print this message


Sparky007
Junior Member

Posts: 6
Joined: 08/21/2010

Hello,

Thank you for all your replies.

Lindsay your solution works fine thank you very much.

Regards Mark 

 



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

 

http://mphillipson.users.btopenworld.com/index.htm

 01/12/2012 05:34 PM
User is offline View Users Profile Print this message


bk82
Top-Tier Member

Posts: 215
Joined: 08/04/2007

Sorry, being late to the game, but lists in Advanced Scripting are a red rag to me.

Actually I created an intricate command system with Advanced Scripting for editing lists a while ago, and I used it extensively for quite some time. I created some special commands that I named "zzz3 <mylist>" and "zzz4 <myotherlist>". The commands did nothing; they were just named so I could access them with a script by pressing z a number of times. I could say in a browser "add this website to the list" and it did just that.

However, the scripts were unreliable and worked only about 80 % of the time. The main reason for this was the MyCommands Browser, which is very hard to script and does not really work well with SendKeys commands. For this and other reasons, I gave up using them.

Had I only thought of Lindsay's solution then.

But then again, what I really hate about the lists is that they are limited to 127 characters, which means long URLs, for instance, cannot be stored in them, unless you use some URL shortener. And long file and folder paths would not work, either.



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

DNS 12 Pro, Medical, Premium - German, English, French - Dragon Dictate 3.0, dns.comfort


 


Core i7 950, Windows 7 Ultimate 64-bit, Intel Core i7 950, 12 GB RAM, L2 2MB; Mic: Jabra Chromo NC 2400 USB.


 


www.in2comp.ch 

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


mdl
Senior Member

Posts: 130
Joined: 04/18/2009

depending on how fast you need to update the list, this is easy to do in Vocola -- just generate a new include file and it will be used at the start of the next speech utterance.

If you need to continuously update the list (e.g., a list of files in the current Explorer window), then you need to use NatLink.

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

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