KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Custom command: down 1-100
Topic Summary:
Created On: 09/20/2021 11:46 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 Custom command: down 1-100   - Psithyros - 09/20/2021 11:46 AM  
 Custom command: down 1-100   - Psithyros - 09/20/2021 11:50 AM  
 Custom command: down 1-100   - dilligence - 09/20/2021 11:59 AM  
 Custom command: down 1-100   - dilligence - 09/20/2021 12:04 PM  
 Custom command: down 1-100   - Psithyros - 09/20/2021 12:32 PM  
 Custom command: down 1-100   - Psithyros - 09/20/2021 12:33 PM  
 Custom command: down 1-100   - Alan Cantor - 09/20/2021 12:36 PM  
Keyword
 09/20/2021 11:46 AM
User is offline View Users Profile Print this message

Author Icon
Psithyros
Junior Member

Posts: 31
Joined: 01/30/2021

Hi all. Could someone please help me out with the most efficient way to create an advanced scripting command in Dragon to press the same key multiple times in sequence using a numbered list variable, e.g. "Down <1to100>"? I experimented with a command that looks like this:

 

If _arg1 = "one" then SendKeys "{Down 1}"

If _arg1 = "two" then SendKeys "{Down 2}"

etc…

 

But this didn't work so I guess I'm doing something wrong!

 09/20/2021 11:50 AM
User is offline View Users Profile Print this message

Author Icon
Psithyros
Junior Member

Posts: 31
Joined: 01/30/2021

NB: I have already created the relevant list.
 09/20/2021 11:59 AM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1432
Joined: 08/16/2010

Try this Global Direction command:

 

<1to200> <global_direction>

 

if _arg2 = "Left" then SendKeys "{Left "  + _arg1 + "}"

if _arg2 = "Right" then SendKeys "{Right "+ _arg1 +"}"

if _arg2 = "Up" then SendKeys "{Up "+ _arg1 +"}"

if _arg2 = "Down" then SendKeys "{Down "+ _arg1 +"}"

 

Both lists should be natively present in Dragon®. If the global_direction list isn't, this is the contents:

 

Down

Left

Right

Up

 

You may probably want to reverse the argument order in the command name:

 

<global_direction> <1to200> 



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


Auto Box© Demo now available



 09/20/2021 12:04 PM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1432
Joined: 08/16/2010

So example commands would be:

 

4 Down, 125 Up, 80 Left, 7 Right

 

If you change the order of the arguments in the command name:

 

Down 4, Up 125, Left 80, Right 7

 

Hmm, I initially attached this DVC command as XML, but attaching does not seem to work on the forum anymore...

 



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


Auto Box© Demo now available



 09/20/2021 12:32 PM
User is offline View Users Profile Print this message

Author Icon
Psithyros
Junior Member

Posts: 31
Joined: 01/30/2021

Thanks for this quick and helpful reply! Seems to work perfectly.
 09/20/2021 12:33 PM
User is offline View Users Profile Print this message

Author Icon
Psithyros
Junior Member

Posts: 31
Joined: 01/30/2021

I went with global direction as arg1 so ended up with the code:

if _arg1 = "Left" then SendKeys "{Left " + _arg2 + "}"
if _arg1 = "Right" then SendKeys "{Right "+ _arg2 +"}"
if _arg1 = "Up" then SendKeys "{Up "+ _arg2 +"}"
if _arg1 = "Down" then SendKeys "{Down "+ _arg2 +"}"
 09/20/2021 12:36 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 4183
Joined: 12/08/2007

As an Advanced Scripting "list command"...

Down <1to100>

Sub Main
Dim Count As String
Let Count = ListVar1
SendKeys "{Left " & Count & "}", True
End Sub

While typing in the command name, the moment you press the less-than sign, create a new list called <1to100>. Type in or dictate or copy in this:

1
2
3
4
etc.
etc.
etc.
100

Personally, I haven't found commands like this to be as useful as I first imagined. That's because estimating numbers larger than 20 or 30 seems to be hit and miss, at least for me. If I were to say, for example, "Down 77," chances are good I'm going to be off the mark, maybe by a wide margin!
Statistics
32177 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 1 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 291 guests browsing this forum, which makes a total of 292 users using this forum.

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