KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Simple script for rapid tab changing in browsers
Topic Summary:
Created On: 08/10/2020 06:17 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Simple script for rapid tab changing in browsers   - benTalks - 08/10/2020 06:17 PM  
 Simple script for rapid tab changing in browsers   - dilligence - 08/10/2020 10:48 PM  
 Simple script for rapid tab changing in browsers   - benTalks - 08/11/2020 06:45 PM  
 Simple script for rapid tab changing in browsers   - Lunis Orcutt - 08/11/2020 07:45 PM  
 Simple script for rapid tab changing in browsers   - PG LTU - 08/11/2020 11:20 AM  
 Simple script for rapid tab changing in browsers   - Alan Cantor - 08/12/2020 07:43 AM  
 Simple script for rapid tab changing in browsers   - Matt_Chambers - 08/12/2020 08:03 AM  
 Simple script for rapid tab changing in browsers   - Alan Cantor - 08/12/2020 11:13 AM  
 Simple script for rapid tab changing in browsers   - benTalks - 09/15/2020 06:06 PM  
 Simple script for rapid tab changing in browsers   - benTalks - 08/12/2020 12:13 PM  
 Simple script for rapid tab changing in browsers   - Alan Cantor - 08/12/2020 01:04 PM  
 Simple script for rapid tab changing in browsers   - PG LTU - 08/12/2020 01:52 PM  
 Simple script for rapid tab changing in browsers   - Lunis Orcutt - 08/13/2020 01:37 AM  
Keyword
 08/10/2020 06:17 PM
User is offline View Users Profile Print this message

Author Icon
benTalks
Junior Member

Posts: 24
Joined: 04/27/2020

How would I write a script that allows me to target tabs by number?

In Firefox and Chrome, alt + 1 switches to tab 1, alt + 2 to tab 2, etc.

Rather than making a shortcut for tabs 1-9, it would be helpful to have a script that takes 'tab {num}' as input.

 08/10/2020 10:48 PM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1124
Joined: 08/16/2010

I've been using this fast DVC list command for years. Works both on Edge and Chrome:

 

Bar <1to9>

 

if _arg1 = "1" then SendKeys "{Ctrl+1}"

if _arg1 = "2" then SendKeys "{Ctrl+2}"

if _arg1 = "3" then SendKeys "{Ctrl+3}"

if _arg1 = "4" then SendKeys "{Ctrl+4}"

if _arg1 = "5" then SendKeys "{Ctrl+5}"

if _arg1 = "6" then SendKeys "{Ctrl+6}"

if _arg1 = "7" then SendKeys "{Ctrl+7}"

if _arg1 = "8" then SendKeys "{Ctrl+8}"

if _arg1 = "9" then SendKeys "{Ctrl+9}"  

 

List content:

1

2

3

4

5

6

7

8

9

Why "Bar" instead of "Tab"? Well, it is understood much better by Dragon.



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

www.speechproductivity.eu 


SP 6 PRO - The Dragon Enhancement & Productivity Suite



 08/11/2020 06:45 PM
User is offline View Users Profile Print this message

Author Icon
benTalks
Junior Member

Posts: 24
Joined: 04/27/2020

Thanks, this is super helpful.

It's not working, though. Did I miss something?



tabby.png
tabby.png  (67 KB)



 08/11/2020 07:45 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 37978
Joined: 10/01/2006

This would be 1 of the many reasons for KnowBrainer 2017 (w/2020 AI Commands). The following KnowBrainer command works great for us and you can copy it, as is, into DPI 15. You can either change the list or add <1st_9th>. If you make this command global, you can use it in any browser. Sorry about the picture being a little large for this insert.

 

 

.



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

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



 08/11/2020 11:20 AM
User is offline View Users Profile Print this message

Author Icon
PG LTU
Top-Tier Member

Posts: 2072
Joined: 03/21/2007

+1 DVC still rules.

Btw, now you know the real reason I have added "teb" as a word that is mapped to produce a tab (and also btw, "tab" needs to be added too, as only "tab key" and "press tab" are officially supported as the way to get a tab):
https://www.nuance.com/products/help/dragon/dragon-for-pc/enx/professionalgroup/main/Content/CommandandControl/using_your_keyboard.htm

To press the Tab key:
Say "Press Tab" or "Tab key"

Hth,



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




PG





Remember folks, my comments and this forum are for entertainment value only, please, no wagering or other reliance on the contents herein.  I permit no commercial use of my ideas (whether expressions or embodiments) without my written consent.



 08/12/2020 07:43 AM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 3841
Joined: 12/08/2007

The reason the command isn't working is that you made it an Advanced Scripting command rather than a DVC command.

I don't think there is enough of an advantage to redo your command as a DVC. With a minute of copying and pasting, your command should work fine as an Advanced Scripting command.

Change the word "SendKeys" to "SendSystemKeys"

Or substitute "SendDragonKeys", which in some (but not all) versions of Dragon, executes more quickly.



 08/12/2020 08:03 AM
User is offline View Users Profile Print this message

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 254
Joined: 08/09/2018

Or do it this way, as an Advanced Scripting command:

"tab <1to10a>"

Sub Main
x = ListVar1
If InStr(x,"\") Then x = Left(x,InStr(x,"\")-1)
SendKeys "^"& x &"""
End Sub

With the List 1to10a consisting of:
10
1\one
2\two
2\to
2\too
3\three
4\four
4\for
5\five
6\six
7\seven
8\eight
9\nine
 08/12/2020 11:13 AM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 3841
Joined: 12/08/2007

Here is another way...

Sub Main
Dim x as String
x = Left(ListVar1,1)
SendKeys "^"& x &"""
End Sub

<1to9> consists of

1
2
3
4
5
6
7
8
9
 09/15/2020 06:06 PM
User is offline View Users Profile Print this message

Author Icon
benTalks
Junior Member

Posts: 24
Joined: 04/27/2020

Originally posted by: Alan Cantor Here is another way... Sub Main Dim x as String x = Left(ListVar1,1) SendKeys "^"& x &""" End Sub <1to9> consists of 1 2 3 4 5 6 7 8 9

I'm using this script, but I notice that it adds quote marks sometimes when I switch between tabs. Is there something I should edit?

 

 08/12/2020 12:13 PM
User is offline View Users Profile Print this message

Author Icon
benTalks
Junior Member

Posts: 24
Joined: 04/27/2020

@Alan: That worked, thank you.

I'm not clear on how to create a DVC. As far as I can tell, Dragon's knowledge base has almost no information on this.
 08/12/2020 01:04 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 3841
Joined: 12/08/2007

The only way that I know to create DVC commands is to make a copy of an existing one (e.g., "mousegrid" or "mouse <1to9>"), open the newly-copied command, and delete (or modify) the existing script.

 

Edit: I suppose one could export a DVC command in XML format, open the command in a text editor, edit it, and re-import it into the Command Browser. Definitely a high-wire act!



 08/12/2020 01:52 PM
User is offline View Users Profile Print this message

Author Icon
PG LTU
Top-Tier Member

Posts: 2072
Joined: 03/21/2007

Originally posted by: Alan Cantor  I don't think there is enough of an advantage to redo your command as a DVC.

 

True in this case, Alan. 

 

But keep in mind I (for one) absolutely notice that Dragon Voice Commands ("DVC") macros hit the screen faster than Dragon Advanced Scripting ("DAS") macros.  For "text editing" type macros, this speed in execution is critical.

 

But for anything that includes any requirement to move or open or focus on something, it won't make a difference because either (i) the user is naturally pausing to take in the thing moved to or opened or focused on, or else (ii) the macro that is doing the moving, opening and focusing is "pushing" (type into a control, press a button, select a choice or some text) or "popping" (copy from, get input, read characters or pixel colors) info from somewhere while doing something else, and again, the difference in timing will be inconsequential.



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




PG





Remember folks, my comments and this forum are for entertainment value only, please, no wagering or other reliance on the contents herein.  I permit no commercial use of my ideas (whether expressions or embodiments) without my written consent.

 08/13/2020 01:37 AM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 37978
Joined: 10/01/2006

+Alan, when Nuance really releases 15.6, you won't notice a speed difference between Advanced Scripting and DVC scripts because of the new WinWrap Basic engine. DVC scripts are noticeably faster and often more bulletproof in Dragon 15.3 because of the circa 2006 SAX scripting engine.

 



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

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

Statistics
31783 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 0 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 591 guests browsing this forum, which makes a total of 591 users using this forum.

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