KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: slow, balky command
Topic Summary: partial and slow deployment
Created On: 06/24/2009 03:14 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 slow, balky command   - mkweiss - 06/24/2009 03:14 PM  
 slow, balky command   - R. Wilke - 06/24/2009 03:28 PM  
 slow, balky command   - mkweiss - 06/24/2009 03:46 PM  
 slow, balky command   - bk82 - 06/25/2009 07:58 AM  
 slow, balky command   - mkweiss - 06/25/2009 10:47 AM  
 slow, balky command   - R. Wilke - 06/25/2009 10:53 AM  
 slow, balky command   - Chucker - 06/25/2009 11:15 AM  
 slow, balky command   - R. Wilke - 06/25/2009 11:48 AM  
Keyword
 06/24/2009 03:14 PM
User is offline View Users Profile Print this message


mkweiss
Power Member

Posts: 68
Joined: 12/21/2006

I use the following script multiple times daily in Wordpad, and it usually is somewhat slow to deploy, and sometimes only partially deploys.

Sub Main
 'SetMicrophone 0
 SendKeys"  "
 SendKeys Format(Now, "m-d-yyyy",.01
 SendKeys "%of{tab 2}6~",1
 SendKeys" marlon weiss, m.d. ~",0
 HeardWord "\Cap"
 'SendKeys ""
 'SetMicrophone 1
End Sub

 Any ideas to make it more bulletproof? It almost seems to be worse if I breathe after the command, but that should not effect it with the microphone lines.

 06/24/2009 03:28 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 4392
Joined: 03/04/2007

I don't think that ending a line starting with SendKeys other than ",1" makes much sense, especially not like this: ",01".

Ending it with ",1" is equivalent to ",True", ",0" means ",False".

"True" is supposed to cause the following line to deploy only after the current line is processed.

So, I'd suggest consolidating the code with regards to this. Other than that, I don't see anything wrong here, but can't tell of course, not knowing what the script is supposed to do.

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!

 06/24/2009 03:46 PM
User is offline View Users Profile Print this message


mkweiss
Power Member

Posts: 68
Joined: 12/21/2006

Script simply inserts the date, my name in small print, and gets ready for next line to start with a capital.
 06/25/2009 07:58 AM
User is offline View Users Profile Print this message


bk82
Top-Tier Member

Posts: 215
Joined: 08/04/2007

Sometimes, when putting many shortcut keys into one line, it may be too fast for the computer to recognize. Then, the script will execute only partially or not at all. That's why I have changed the middle part of your script. By the way, it works in DragonPad too.

Try this: 

Sub Main
 SetMicrophone 0
 SendKeys "  " ' what do you need these for?
 SendKeys Format(Now, "m-d-yyyy", 1 ' remove the smiley upon import
 SendKeys "%o", 1
 SendKeys "f"",1
 SendKeys "{tab 2}6~ ", 1
 SendKeys "marlon weiss, m.d. ~", 1
 HeardWord "\Cap"
SendKeys ""
SetMicrophone 1
End Sub



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

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 

 06/25/2009 10:47 AM
User is offline View Users Profile Print this message


mkweiss
Power Member

Posts: 68
Joined: 12/21/2006

simplified as follows instead:

 

Sub Main
 SendKeys"  " 'need space
 SendKeys Format(Now, "m-d-yyyy",1
 SendKeys "%of{tab 2}6~",1
 SendKeys" marlon weiss, m.d. ~",1
 HeardWord "\Cap" 'need line to start with capital
End Sub

sometimes works great, other times see it all print, then dragon erases back to the end of the date.

 06/25/2009 10:53 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 4392
Joined: 03/04/2007

Quote:
sometimes works great, other times see it all print, then dragon erases back to the end of the date.

Then just add wait times in between some lines, like e.g. "Wait 0.5", and play with it until you get it working bulletproof. I also assume that mispelling the grammar as presented here may be just a glitch.

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!

 06/25/2009 11:15 AM
User is offline View Users Profile Print this message

Author Icon
Chucker
Top-Tier Member

Posts: 9671
Joined: 10/10/2006

Marion,

In addition to Rüdiger's two cents, consider changing the first line of your script from SendKeys " " to SendKeys "{Space}.

If you use that for adding spaces, then it is a very simple process of making modifications to the number of spaces that you need by simply adding that after {Space}, such as {Space 2} or {Space 3}, etc. yes, it's just as simple to simply add spaces between the quotation marks.  However, if you only need one or two spaces, that's a simple process.  After that, for example, if you need to add 10 spaces, it just simply gets a lot harder to count the number of spaces.  Using the {Space #} means that you never have to count in order to be sure that you get the exact number of spaces.

I know that I'll get some feedback on why this is a necessary, but I learned a long time ago from one of the best programmers in the world that there were two critical points to programming: (1) the best programming code is written in the fewest number of lines, and (2) the best programming code uses the most efficient command structure.  I've simply follow that whenever I write my own programs or scripts.

Chuck Runquist
Owner, GEMCCON - The Choice of Intelligence
Speech Recognition Consulting and Training

The major difference between a thing that might go wrong and a thing that cannot possibly go wrong is that when a thing that cannot possibly go wrong goes wrong, it usually turns out to be impossible to get at or repair.- Douglas Adams (1952 - 2001)

 



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

 06/25/2009 11:48 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 4392
Joined: 03/04/2007

Chuck,

waiting for feedback? - Good catch!

SendKeys " " may work, but using {Space} definitely works better. I only use "" for testing whether a string variant is empty, or setting it so.

Thanks!

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!

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

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