![]() |
KnowBrainer Speech Recognition | ![]() |
Topic Title: Auto numbering websites using Dragon States Topic Summary: Using SetState to keep track of what is being numbered Created On: 09/16/2020 11:24 PM Status: Post and Reply |
|
![]() |
![]() |
- PG LTU | - 09/16/2020 11:24 PM |
![]() |
![]() |
- Alan Cantor | - 09/17/2020 12:07 AM |
![]() |
![]() |
- PG LTU | - 09/17/2020 12:45 AM |
![]() |
![]() |
- Mav | - 09/17/2020 03:12 AM |
![]() |
![]() |
- wristofdoom | - 02/12/2022 11:37 AM |
![]() |
|
Thanks to a paricular odd suggestion by Mav about using States to store information got me thinking. Here to show the potential is a set of browser "numbering" commands that use State to keep track of what is being numbered.
So the application-specific command (for edge or chrome, etc or one app-specific commands for each) is "Pick [browsercontrol]" and it numbers all the matching browser elements from this list:
and it sets the State to that element type.
Here is the command:
Now the fun part. The application-specific command to choose the number is "Pick [1to200]" but you have to also add the following States as well:
Button, Check, Edit, Image, Link, Radio, and Text
and the command will click the numbered element and go to the new page and then renumber all the elements on the new page (by seeing what the state is that the earlier commnd set). Here's that command:
Lemme know if you try it... -------------------------
|
|
|
|
![]() |
|
The recent mention of states got me wondering, and a few days ago, I sort-of figured out how to take advantage of states.
The first command provides an easier way to navigate in drop-down lists within Word documents. These drop downs are not particularly Dragon friendly. This command sets a state. The second command is only recognized when the state has been set by the first command. The name of the second command is "OK". The command accepts the selected item on the drop-down, navigates to the next drop-down list, and then opens another drop-down list. When this command runs, the state is turned off. This means "OK" is recognized as a command in drop-down lists in Microsoft Word documents, but as a regular word in a Word document. Command: Jump To <1-5> Sub Main ' Do something SetState "drop-down-focused" End Sub Command: OK [Recognizable in State drop-down-focused] Sub Main SendKeys "{Enter}" SendKeys "{Tab}", True SendSystemKeys "{Alt+Down}" SetState "" End Sub |
|
|
|
![]() |
|
Cool. If you really want to learn states, check out the Sample structured state commands and compare the WordPad to the Dragon Pad approaches.
Note, this is all Dragon's built-in numbering and no fancy add-ons required - I can even do it at work! -------------------------
|
|
|
|
![]() |
|
Cool! I've looked at the state sample commands and also found that you can only SetState for states which have be defined in voice commands outside the script, defying the idea to use dynamic values for states. Did you find a way to create a voice command from within a script that's bound to a certain state?
mav |
|
|
|
![]() |
|
I would love some way to use states with the global scope, so that a set of state-based commands would work across various applications when I'm doing certain types of work.
For example, when I say "heading one", that could mean different things depending on whether I am writing in plain text, HTML, or markdown. But it seems like is limited to Application-specific commands. (I wonder why?) Is there any sort of workaround that would allow me to set a stay globally? I tried creating a command called `set global state` that set a new variable myGlobalState to "testing" and then created a completely separate command called `print global state` that does `Sendkeys myGlobalState` but that didn't work. I understand why we would want to have variables scoped within an individual command, but is there some way to make a variable global? ------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
FuseTalk Standard Edition v4.0 - © 1999-2022 FuseTalk™ Inc. All rights reserved.