![]() |
KnowBrainer Speech Recognition | ![]() |
Topic Title: Simple script for rapid tab changing in browsers Topic Summary: Created On: 08/10/2020 06:17 PM Status: Post and Reply |
|
![]() |
![]() |
- benTalks | - 08/10/2020 06:17 PM |
![]() |
![]() |
- dilligence | - 08/10/2020 10:48 PM |
![]() |
![]() |
- benTalks | - 08/11/2020 06:45 PM |
![]() |
![]() |
- Lunis Orcutt | - 08/11/2020 07:45 PM |
![]() |
![]() |
- PG LTU | - 08/11/2020 11:20 AM |
![]() |
![]() |
- Alan Cantor | - 08/12/2020 07:43 AM |
![]() |
![]() |
- Matt_Chambers | - 08/12/2020 08:03 AM |
![]() |
![]() |
- Alan Cantor | - 08/12/2020 11:13 AM |
![]() |
![]() |
- benTalks | - 09/15/2020 06:06 PM |
![]() |
![]() |
- benTalks | - 08/12/2020 12:13 PM |
![]() |
![]() |
- Alan Cantor | - 08/12/2020 01:04 PM |
![]() |
![]() |
- PG LTU | - 08/12/2020 01:52 PM |
![]() |
![]() |
- Lunis Orcutt | - 08/13/2020 01:37 AM |
![]() |
|
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. |
|
|
|
![]() |
|
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. ------------------------- |
|
|
|
![]() |
|
|
|
![]() |
|
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 |
|
|
|
![]() |
|
+1 DVC still rules. -------------------------
|
|
|
|
![]() |
|
The reason the command isn't working is that you made it an Advanced Scripting command rather than a DVC command. |
|
|
|
![]() |
|
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 |
|
|
|
![]() |
|
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?
|
|
|
|
![]() |
|
@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. |
|
|
|
![]() |
|
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! |
|
|
|
![]() |
|
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. -------------------------
|
|
|
|
![]() |
|
+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 |
|
|
FuseTalk Standard Edition v4.0 - © 1999-2021 FuseTalk™ Inc. All rights reserved.