KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Macro for MouseGrid commands
Topic Summary: in DVC
Created On: 04/14/2017 02:02 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Macro for MouseGrid commands   - dilligence - 04/14/2017 02:02 PM  
 Macro for MouseGrid commands   - Lunis Orcutt - 04/14/2017 03:03 PM  
 Macro for MouseGrid commands   - dilligence - 04/14/2017 04:58 PM  
 Macro for MouseGrid commands   - MikeJ - 04/14/2017 09:50 PM  
 Macro for MouseGrid commands   - dilligence - 04/15/2017 06:34 AM  
 Macro for MouseGrid commands   - MikeJ - 04/15/2017 12:09 PM  
 Macro for MouseGrid commands   - dilligence - 04/15/2017 06:17 PM  
 Macro for MouseGrid commands   - Tomc - 01/12/2021 10:42 PM  
 Macro for MouseGrid commands   - dilligence - 01/13/2021 10:05 AM  
Keyword
 04/14/2017 02:02 PM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1298
Joined: 08/16/2010

For those who love DVC commands and still use the native mouse grid commands. I have rediscovered them completely since I found that mouse position commands don't always work reliably when an application has a child window in the foreground open while you want to approach a button or menu in the background window (DAWs for instance, and also some photo editing programs).

Previously I used macro recorder scripts for this but, apart from the fact that they take up a lot of space in the Command Browser, they also don't always work reliably.

 

Of course I don't use the MouseGrid to navigate but I only use it once to figure out the MouseGrid coordinates for a specific button or menu I want to click on:

mouse 1, 6,2,9 for instance.

 

To speed up the process of quickly creating a DVC command with these grid numbers I created the following commands (based on the KB Heard<number>Word Verbal Basic commands).

 

Heard1-5Grid(s)

The command: "Heard four Grids" , for instance, types out the following:

 

HeardWord "mouse","","","",""

ButtonClick 1,1

 

And places to cursor between the first empty quotes.

Following the above example you would then (in Dragon 15) only have to say:

 

one, right two, six, right two, two, right two, nine, right two

 

And save the command.

 

I could use a little help making these five separate commands into one list (DVC) command.

 

 

Rob

 



HWGrids.xml
HWGrids.xml  (4 KB)



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

 04/14/2017 03:03 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 38667
Joined: 10/01/2006

We never use MouseGrid commands because we haven't found the need in KnowBrainer 2017 but if you need a slower approach, try the following as a standard Dragon Advanced-Scripting command but note that depending on your computer, you may have to increase the wait times slightly:

Sub Main
MouseGrid 1,1
Wait 0.1
MouseGrid 1,6
Wait 0.1
MouseGrid 1,2
Wait 0.1
MouseGrid 1,9
Wait 0.3
ButtonClick 1,1

End Sub


If you wish to create a KnowBrainer or Dragon DVC macro (which are both faster), use the following: Note that the 1st script uses the entire screen while the 2nd script begins with a smaller MouseGrid window script which is produced by using 1 for full screen and 2 for window:

Full Screen Example

MouseGrid 1,1
MouseGrid 1,3
MouseGrid 1,9
MouseGrid 1,2
Wait 100
ButtonClick 1,1


Window Grid Example

MouseGrid 2,1
MouseGrid 1,3
MouseGrid 1,9
MouseGrid 1,2
Wait 100
ButtonClick 1,1


 

 



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

Forum Mission Statement
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ext 1



 04/14/2017 04:58 PM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1298
Joined: 08/16/2010

Lunis, that is kind of a result of my macro. What I would like is to have the following 5 (creation) commands bundled in one list command. Is that possible?

 

Heard one Grid

 

SendKeys "HeardWord {""}{""},{""}{""}{Left 4}"

SendKeys "mouse"

SendKeys "{Right 6}"

SendKeys "{End}"

SendKeys "{Enter}"

SendKeys "ButtonClick 1,1"

SendKeys "{Left 17}"

 

 

Heard two Grids

 

SendKeys "HeardWord {""}{""},{""}{""},{""}{""}{Left 7}"

SendKeys "mouse"

SendKeys "{Right 3}"

SendKeys "{End}"

SendKeys "{Enter}"

SendKeys "ButtonClick 1,1"

SendKeys "{Left 20}"

 

 

Heard three Grids

 

SendKeys "HeardWord {""}{""},{""}{""},{""}{""},{""}{""}{Left 10}"

SendKeys "mouse"

SendKeys "{Right 3}"

SendKeys "{End}"

SendKeys "{Enter}"

SendKeys "ButtonClick 1,1"

SendKeys "{Left 23}"

 

 

Heard four Grids

 

SendKeys "HeardWord {""}{""},{""}{""},{""}{""},{""}{""},{""}{""}{Left 13}"

SendKeys "mouse"

SendKeys "{Right 3}"

SendKeys "{End}"

SendKeys "{Enter}"

SendKeys "ButtonClick 1,1"

SendKeys "{Left 26}"

 

 

Heard five Grids

 

SendKeys "HeardWord {""}{""},{""}{""},{""}{""},{""}{""},{""}{""},{""}{""}{Left 16}"

SendKeys "mouse"

SendKeys "{Right 3}"

SendKeys "{End}"

SendKeys "{Enter}"

SendKeys "ButtonClick 1,1"

SendKeys "{Left 29}"



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

 04/14/2017 09:50 PM
User is offline View Users Profile Print this message


MikeJ
Top-Tier Member

Posts: 1087
Joined: 10/03/2006

I think this is what you want. You will have to use this with a number list that is pure integers not strings.

 

If _arg1 = "1" Then
  SendKeys "HeardWord {""}{""},{""}{""}{Left 4}"
  LeftPos = CStr (17)
End If
If _arg1 = "2" Then
  SendKeys "HeardWord {""}{""},{""}{""},{""}{""}{Left 7}"
  LeftPos = CStr (20)
End If
If _arg1 = "3" Then
  SendKeys "HeardWord {""}{""},{""}{""},{""}{""},{""}{""}{Left 10}"
  LeftPos = CStr (23)
End If
If _arg1 = "4" Then
  SendKeys "HeardWord {""}{""},{""}{""},{""}{""},{""}{""},{""}{""}{Left 13}"
  LeftPos = CStr (26)
End If
If _arg1 = "5" Then
  SendKeys "HeardWord {""}{""},{""}{""},{""}{""},{""}{""},{""}{""},{""}{""}{Left 16}"
  LeftPos = CStr (29)
End If

SendKeys "mouse"
SendKeys "{End}"
SendKeys "{Enter}"
SendKeys "ButtonClick 1,1"
SendKeys "{Left " +LeftPos+ "}"

 

 



 04/15/2017 06:34 AM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1298
Joined: 08/16/2010

Thank you Mike, works like a charm!

There's always so much to learn here on the forum. I will use this one also as a template to create more commands.

Rob



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

 04/15/2017 12:09 PM
User is offline View Users Profile Print this message


MikeJ
Top-Tier Member

Posts: 1087
Joined: 10/03/2006

Rob,

You are quite welcome. I'm assuming you have the DVC scripting manual that came with the early versions of Dragon? If not, PM me a good email address for you and I'll send it to you.
 04/15/2017 06:17 PM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1298
Joined: 08/16/2010

Mike,

 

Yes I have that scripting guide (Creating Voice Commands), personally I think it's better than Larry Allen's advanced scripting guide. I'm still learning (no mathematical background whatsoever).

But like Lunis said, advanced scripting is painfully slow in Dragon 15, so I'm mainly focusing on DVC commands and KB commands.

Thanks again,

Rob



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

 01/12/2021 10:42 PM
User is offline View Users Profile Print this message

Author Icon
Tomc
New Member

Posts: 18
Joined: 10/14/2019

Pardon my simplistic question, but I want a command that will do the same as when I say "MouseGrid 1, 4, 5, Click". How would I do this?
 01/13/2021 10:05 AM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1298
Joined: 08/16/2010

Basically this should work:

 

HeardWord "Mouse","1","4","5","click"

 

However, for some reason on my computer I need to use the written form (HeardWord can be tricky sometimes):

 

HeardWord "Mouse","one","four","five","click"

 

Preferably use no more than three numbers to get reliable results.



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



Statistics
31980 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 552 guests browsing this forum, which makes a total of 553 users using this forum.

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