KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: KB Command Question
Topic Summary: Is this possible?
Created On: 03/25/2012 03:31 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 KB Command Question   - jgold55 - 03/25/2012 03:31 PM  
 KB Command Question   - R. Wilke - 03/25/2012 04:37 PM  
 KB Command Question   - jgold55 - 03/25/2012 04:48 PM  
 KB Command Question   - R. Wilke - 03/25/2012 05:05 PM  
 KB Command Question   - jgold55 - 03/25/2012 05:10 PM  
 KB Command Question   - R. Wilke - 03/26/2012 07:04 AM  
 KB Command Question   - jgold55 - 03/26/2012 08:19 AM  
 KB Command Question   - Jomark - 03/26/2012 09:43 AM  
 KB Command Question   - jgold55 - 03/26/2012 09:54 AM  
 KB Command Question   - Jomark - 03/26/2012 10:09 AM  
 KB Command Question   - jgold55 - 03/26/2012 12:19 PM  
 KB Command Question   - Lunis Orcutt - 03/26/2012 03:07 PM  
Keyword
 03/25/2012 03:31 PM
User is offline View Users Profile Print this message


jgold55
Power Member

Posts: 77
Joined: 09/19/2010

   Is it possible to write a KnowBrainer command and  during the keystroke sequence of the command insert a text macro?  For example, I have the cursor migrating to different places in an application, and then opening up the notes section, and then opening the DragonPad.  I would like after opening the DragonPad to insert one of my text macros (which is part of the DNS commands).  I cannot seem to be able to do this. Can it be done with DNS Pro as opposed to Premium?

   Thanks for the replies.



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

HP Pavillion dv7;

 03/25/2012 04:37 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 4392
Joined: 03/04/2007

If I am not mistaken, you can use the HeardWord command also in KnowBrainer. Therefore, if you have a text macro named "my signature", for instance, the following line of code would execute it:

HeardWord "my","signature"

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!

 03/25/2012 04:48 PM
User is offline View Users Profile Print this message


jgold55
Power Member

Posts: 77
Joined: 09/19/2010

Rudiger:

 Thanks for the reply.  I've tried that.  I have a macro called "exam form ok".  It didn't work with the HeardWord command.  Not sure if I should use HeardWord or "Heard 3 Words".  I might have tried both and neither worked. 

 

Will this work with DNS Preferred or do I need DNS Professsional?



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

HP Pavillion dv7;

 03/25/2012 05:05 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 4392
Joined: 03/04/2007

Quote:
"Heard 3 Words".

There is no such animal. The general syntax would be:

HeardWord "word1", "word2", "word3"

So given this example:

HeardWord "exam", "form", "ok"

But I would actually make that:

HeardWord "exam", "form", "okay"

But don't forget to rename the command first. However, I am not really certain about HeardWord commands being available in KnowBrainer, but I thought they were.

Rüdiger

Edit: I have just checked with the KnowBrainer manual, and they ARE available. So just check the syntax accordingly.

 



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

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!

 03/25/2012 05:10 PM
User is offline View Users Profile Print this message


jgold55
Power Member

Posts: 77
Joined: 09/19/2010

Rudiger:

 Thanks.  Will give it a go again.

I have succeeded in being able to insert the text macro as desired, thanks for your help.  I am also able to migrate within the macro using KnowBrainer bookmark commands.  

However, I am unable to have the system insert "today's date" into the place  I wish.  Knowbrainer rejects what I am doing based on a syntax error.

I am unable to find the "today's date" command in the Knowbrainer commands so I can copy it into my command.

What is the correct command syntax for "today's date".  I tried using a HeardWord command and it was rejected.

 Thanks. 



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

HP Pavillion dv7;

 03/26/2012 07:04 AM
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 there is such a thing as a "today's date" command. Why don't you get yourself a copy of the KnowBrainer VerbalBasic manual which would cover it, I believe?

As far as the HeardWord command, the simple rule to using it in a script is this: if you can speak it, you can also execute it from the script using the HeardWord command. It just does the same thing, instructing the scripting engine to act as if the command had been spoken, or heard for that matter.

Rüdiger

PS: inserting the date can be done via Advanced Scripting however, by using a specific macro to retrieve it from the system first.

 



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

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!

 03/26/2012 08:19 AM
User is offline View Users Profile Print this message


jgold55
Power Member

Posts: 77
Joined: 09/19/2010

Actually, there is a today's date command.  There is also a yesterdays date command.  I use them routinely.  However, for some reason they do not execute during this particular sequence. And, as I mentioned, KnowBrainer rejects them as having the "incorrect syntax" when inserted as a HeardWord command.

I do have the VerbalBasic™ manual.  It does not list this particular command.
 
I've posted the complete command sequence below:


MouseGrid 1,1
Wait 300
MouseGrid 1,7
Wait 300
MouseGrid 1,2
Wait 300
ButtonClick 1,1 

MouseGrid 1,1 
Wait 300
MouseGrid 1,3
Wait 300
MouseGrid 1,4
Wait 300
ButtonClick 1,1

MouseGrid 1,1
Wait 300
MouseGrid 1,9
Wait 300
MouseGrid 1,5
Wait 300
MouseGrid 1,8
Wait 300
ButtonClick 1,1
Wait 300
HeardWord "start","DragonPad" 
Wait 300 
HeardWord "Exam", "Form", "Okay"
Wait 300
SendSystemKeys "{Ctrl+Home}"
Wait 300
HeardWord "select","[","zero","one","]"
Wait 300
HeardWord "Today"
Wait 300
HeardWord "select","[","zero","two","]"
Wait 300

Where it says "HeardWord Today" is the problem.  Whether I insert the words "Today's", "Date" or "Today's Date" it doesn't work.  When I insert the word "Date", then the word "date" is inserted into the end document.  So I am not sure why the Today's Date command doesn't work in the sequence.

 


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

HP Pavillion dv7;

 03/26/2012 09:43 AM
User is offline View Users Profile Print this message


Jomark
Top-Tier Member

Posts: 1302
Joined: 10/19/2006

Quote:
the Today's Date command doesn't work in the sequence

Is it because you have the apostrophe betwen the 'y' and 's'? the command is Todays Date

The advanced scripting code is

Sub Main
 Dim Todays As Date
 Todays = Now
 SendDragonKeys WeekdayName(Weekday(Todays)) & " "

 SendDragonKeys Day(Todays) & ", "
 SendDragonKeys MonthName(Month(Todays)) & " " & Year(Todays)
End Sub

As you have DNS Premium, you would need to modify this to include it as a KnowBrainer command.

Another option might be to create a command called Todays Date

SendKeys  Format(Now,  "dd mmmm yyyy" )

 



-------------------------
Jomark
 03/26/2012 09:54 AM
User is offline View Users Profile Print this message


jgold55
Power Member

Posts: 77
Joined: 09/19/2010

Jomark:

Thanks for the reply.  Tried it, and still the cursor goes from bookmark 1 (where I want to insert the date) to bookmark 2 without executing and inserting the date.

 



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

HP Pavillion dv7;

 03/26/2012 10:09 AM
User is offline View Users Profile Print this message


Jomark
Top-Tier Member

Posts: 1302
Joined: 10/19/2006

Quote:
Thanks for the reply. Tried it, and still the cursor goes from bookmark 1 (where I want to insert the date) to bookmark 2 without executing and inserting the date.

Check to see if you have the commands "Todays Date" and "Yesterdays Date" listed in your KnowBrainer system.dvc commands. If not you will need to create them.

I am using DNS Pro and the KnowBrainer commands in the Knowbrainer Extras folder are in advanced scripting format and were inserted into the DNS command browser.

Advanced scripting ability is not available in DNS Premium  but you can create these commands in KnowBrainer.



-------------------------
Jomark
 03/26/2012 12:19 PM
User is offline View Users Profile Print this message


jgold55
Power Member

Posts: 77
Joined: 09/19/2010

Jomark: 
 
Thanks for your great reply.  I may ultimately upgrade to the Pro version.  However, for now, I may try to experiment as you suggested.

As an aside, as I was searching for the Today's Date and Yesterday's Date commands in the Know-Brainer commands, I came across a command in the Notepad commands, "Date Time" which is produced by pressing the F 5 key and the current date and time will appear.  So I think by simply switching from DragonPad to notepad in my command I will be able to produce what I am trying to do.  Will try later on.

Many thanks for your help.
 
 
Later:  Success! How sweet! 


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

HP Pavillion dv7;

 03/26/2012 03:07 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 22624
Joined: 10/01/2006

We are going to use a single message to comment on each response that requires our input because we are exceedingly lazy:

99.99% of NaturallySpeaking commands are hardcoded which has the advantage of making them bulletproof but the disadvantage of not being able to edit them. A very small handful of KnowBrainer commands, such as
Todays Date,
are also hardcoded.

Heard 3 Words is a patented KnowBrainer 2011  VerbalBasic command that is used for creating or editing KnowBrainer commands. When you dictate Heard 3 Words
NaturallySpeaking types the following line of code in the KnowBrainer Command Browser:

Heard "|","",""

and places the cursor in between the 1st pair of quotes.

If you're creating your HeardWord commands from within KnowBrainer, it doesn't matter if you're using the NaturallySpeaking Home Edition, Premium or Professional. However, HeardWord commands have to appear in the same case as the original commands. For example: If you create a boiler plate text command, in the NaturallySpeaking Command Browser, called
Add Signature, additionally create a KnowBrainer command that will HeardWord your original NaturallySpeaking command and you decide to name that command My Signature, the code for that command would be
Heard "Add","Signature" not Heard "add","signature". The case (Title Case or lower case) must appear exactly as your command does and additionally, don't forget that you must close and re-launch KnowBrainer before any New Global Command can take effect.

As far as your command is concerned: Try substituting
HeardWord "Todays","Date" for HeardWord "Today", which is not a command. There is no apostrophe in the KnowBrainer Todays Date command because apostrophes can cause problems.

Jomark’s recommendation would work great in DNS Pro but will not work in KnowBrainer or DNS Premium.

The system.dvc command file in DNS Premium cannot be edited or opened because it is encrypted. Only the system.dvc file that is included in the professional versions of DNS can be edited.


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


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


 


 


 

KnowBrainer Speech Recognition » KnowBrainer Software and Support » KB Command Question

Statistics
27371 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 373 guests browsing this forum, which makes a total of 374 users using this forum.

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