HeardWord Incompetence

Does HeardWord work with user written scripts? I ask because I can't get it to recognize scripts that I've written, whereas the two built-in examples in the "Help" file worked just fine. The kicker here is that I'm working in a Java-based application.

Bruce

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
KnowBrainer's picture

Substitute a dvc command

HeardWord commands are great for accessing built-in NaturallySpeaking commands, boilerplate text commands, dvc commands and even KnowBrainer commands but they don't always work for triggering other Advanced-Scripting commands. One workaround, for this issue, is to substitute a dvc command in place of your Advanced-Scripting command. For this reason, KnowBrainer includes a blank dvc command (for DNS Pro)  and if you don't have access to a blank dvc command, send us a request at supp...@knowbrainer.com and we will send one for you to import.

Lunis Orcutt of the MicrophoneStore
Is Your Speech Mic Vendor Nuance Certified?

KnowBrainer

KnowBrainer wrote:

HeardWord commands are great for accessing built-in NaturallySpeaking commands, boilerplate text commands, dvc commands and even KnowBrainer commands but they don't always work for triggering other Advanced-Scripting commands. One workaround, for this issue, is to substitute a dvc command in place of your Advanced-Scripting command. For this reason, KnowBrainer includes a blank dvc command (for DNS Pro)  and if you don't have access to a blank dvc command, send us a request at supp...@knowbrainer.com and we will send one for you to import.

Lunis Orcutt of the MicrophoneStore
Is Your Speech Mic Vendor Nuance Certified?

Well that would qualify for my "one new thing I learned today"! I do have lots of DVC commands. I'll have to try to convert several of the Advanced Scripting commands to see how far I can go.

My need is to substitute HeardWord for genuine subroutines in an application where the environment on which my commands operate is dynamic. Using HeardWord commands ought to make it easier to keep up with the changes. There is a hierarchical classification system that SFAIK can only be accessed by arrow key combinations. By invoking the smaller number of higher- and middle-level steps via HeardWord scripts, I might be able to minimize the amount of work required to maintain access to the critical lower-level categories as the classification system grows.

Bruce

BTW, another way of

BTW, another way of achieving this sort of thing is using functions in Vocola.

For example, I keep changing how I reach the address bar in IE 7 because of IE 7/Abode reader stupidities. I have a function defined:

Address()   := {f4}{f4} {ctrl+o} Wait(50) {enter} {alt+d} {esc};

And all the commands that need to use this functionality then just call Address(); e.g.,

  # open a new tab with the current URL:
clone URL = Address() {alt+enter};

Vocola makes using the same functions across many commands very easy, unlike Advanced Scripting.

mdl wrote: Vocola makes

mdl wrote:

Vocola makes using the same functions across many commands very easy, unlike Advanced Scripting.

That would make it useful. I hope someday you produce something like a "Vocola Install for Dummies".

Bruce

Collect code in a Uses file

If the code you're trying to kick off with the heardword command is truly a subroutine of some sort, you can collect it in a file that is referenced by the #Uses statement. That could save you from having to convert scripting commands to DVC commands.

Don Nicklas wrote: If the

Don Nicklas wrote:

If the code you're trying to kick off with the heardword command is truly a subroutine of some sort, you can collect it in a file that is referenced by the #Uses statement. That could save you from having to convert scripting commands to DVC commands.

That sounds promising except I have no idea how to do what you suggest. Do you have a hint or reference?

Bruce

#Uses is defined in the Basic Help, but it doesn't help me -- I'm not a programmer and I don't understand all that arcana, like how you would implement the instructions. For example, where would the file that #Uses calls resides within the DNS Command Browser?

In short, modifying my existing scripts to DVC format took about and hour and a half and works well, so KnowBrainer's suggestion was a great help to me -- for as long as DNS scripting is compatible with DVC-format scripts...

Bruce, Naturally, I've

Bruce,

Naturally, I've never used this approach myself.Evil But in case my bluff was called Eye-wink, I played around with the example in the MyCommands help and came up with this: Cool

First create the "module" or code library. The code library is actually a text file you save somewhere on your computer, I saved mine here (this is the path for user Don on a Windows XP machine, yours will likely be different. You can get it from the address line of the folder you save the text file to):

"C:\Documents and Settings\Don\My Documents\macro code libraries\practice code library.txt"

The text file looks like this:

'Module practice code library.txt

Public Function BFunc$(S$)
BFunc$ = UCase(S$)
End Function 


Public Sub comfort (x As String,y As String)
Select Case MsgBox("Do you like dogs?",vbYesNo,"Comfort Level")
Case vbYes
y =x & " Woolly!"
Case vbNo
y =x &" doggie, please don't eat me..."
End Select
MsgBox y
End Sub

Create, in the command browser, create a couple of advanced scripting commands like this:

Command name: "Zulu code library cat"

'#Uses "C:\Documents and Settings\Don\My Documents\macro code libraries\practice code library.txt"

Sub Main
MsgBox BFunc$("Hello"),vbOkOnly,"test code module library" '"HELLO"

End Sub

Command name: "Zulu code library dog"

'#Uses "C:\Documents and Settings\Don\My Documents\macro code libraries\practice code library.txt"

Sub Main
Dim y As String
Dim x As String
x= BFunc$("Hello")
comfort x,y
End Sub

Both commands make use of code from the "code library", but they only use what they need. Remember, the #Uses line is the path to the module file you created.

-Don

Don, Thanks, that looks like

Don,

Thanks, that looks like a great bit of sample code. I'm going to try it because it looks like a more general and powerful way to solve the kinds of problems I run into controlling applications. For example, as I photograph new birds, I want to be able to easily adjust the code so that I can just say the name of the species to tag the photograph. Adobe doesn't make it easy to do that.

Bruce

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Syndicate content