![]() |
KnowBrainer Speech Recognition | ![]() |
Topic Title: Looking for tool to generate KnowBrainer/Dragon/... commands from list of keyboard shortcuts Topic Summary: In case anybody has already written this... Created On: 02/13/2020 10:38 PM Status: Post and Reply |
|
![]() |
![]() |
- Ag | - 02/13/2020 10:38 PM |
![]() |
![]() |
- PG LTU | - 02/14/2020 09:48 AM |
![]() |
![]() |
- Edgar | - 02/14/2020 10:53 AM |
![]() |
![]() |
- Edgar | - 02/14/2020 11:02 AM |
![]() |
![]() |
- Lunis Orcutt | - 02/14/2020 02:38 PM |
![]() |
![]() |
- Lunis Orcutt | - 02/14/2020 03:37 PM |
![]() |
![]() |
- kkkwj | - 02/14/2020 11:33 PM |
![]() |
![]() |
- Edgar | - 02/15/2020 11:30 AM |
![]() |
![]() |
- Mphillipson | - 02/15/2020 11:52 AM |
![]() |
![]() |
- PG LTU | - 02/16/2020 03:08 PM |
![]() |
![]() |
- monkey8 | - 02/18/2020 06:11 PM |
![]() |
![]() |
- Ag | - 03/15/2020 08:03 PM |
![]() |
![]() |
- Mphillipson | - 03/25/2020 02:04 PM |
![]() |
![]() |
- Ag | - 03/15/2020 08:01 PM |
![]() |
![]() |
- dilligence | - 03/16/2020 12:19 AM |
![]() |
![]() |
- kkkwj | - 03/24/2020 11:29 PM |
![]() |
![]() |
- R. Wilke | - 03/25/2020 03:47 AM |
![]() |
![]() |
- kkkwj | - 03/25/2020 11:08 AM |
![]() |
![]() |
- Bingos | - 04/13/2020 01:29 AM |
![]() |
![]() |
- Ag | - 02/25/2021 11:31 PM |
![]() |
|||||||||||
Example 1: So, I have finally started using Microsoft Edge with the Dragon/KnowBrainer. There are a few things that I know how to do via keyboard shortcuts that I don't have speech commands for. [*]. Here's a list of keyboard shortcuts: https://support.microsoft.com/en-us/help/4531783/microsoft-edge-keyboard-shortcuts the 1st few lines look something like
and so on
Seems to me I might like to have pretty much all of these keyboard shortcuts as speech commands.
Q: has anyone written a script (Perl/Python/whatever) that will take a list such as that above and generate a set of speech commands?
The descriptions in the "To do this" column are little bit verbose, and I probably would want to massage them. But in many cases they are actually a good start for command names.
Since I put a prefix like "PUFF" or "ZUFF" or "ZOTZ" in front of all my commands, I don't have to worry about conflict thing with normal dictation. I might have to worry about constantly with commands that I've already written, but hey, that's what a script can do.
It should be easy enough to add the appropriate waits between SendKeys. However, in this example, these are all single key shortcuts, nothing needed.
So I imagine I might have an input file that looks something like
Ctrl + D :: Set Favorite Ctrl + E :: Search web Ctrl + F :: Find Ctrl + G :: Next Match ... Let's see, let's find a few more interesting things Ctrl + Shift + M :: switch user Ctrl + Shift + R :: flush cache
And so on.
Doesn't look like a hard script to write. I'm just asking in case anybody's already written such a script, and is willing to share.
There are lists of such keyboard shortcuts all over the web. KnowBrainer has commands for a few of these, but by no means all. (I think people who use on prefixed commands have to be a lot more careful in choosing command names that don't conflict with stuff they ordinarily want to say in normal mode.)
---
Note *: yeah, I need to spend some time updating I KnowBrainer. Perhaps the latest KnowBrainer release has already added all of the commands I could possibly want. But I doubt it. Especially when I get the more technical applications. Visio? The various GitHub shortcuts for IOssues/Wikis/... ?
------------------------- DPG15.6 (also DPI 15.3) + KB, Sennheiser MB Pro 1 UC ML, BTD 800 dongle, Windows 10 Pro, MS Surface Book 3, Intel Core i7-1065G7 CPU @ 1.3/1.5GHz (4 cores, 8 logical, GPU=NVIDIA Quadro RTX 3000 with Max-Q Design. |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
I have such a tool, called "Make Dragon Commands". It takes in a csv file of command names and shortcuts and generates application-specific DVCs (and a customized "What Can I Say" glossary).
Here from the help: IN SHORT: 1. SET UP a CSV file of COMMAND NAMEs and KEYBOARD SHORTCUTs (using SendSystemKeys key names). 2. RUN Make Dragon Commands to create a Dragon XML file. 3. IMPORT this XML file into the Dragon Command Browser and, when done, 4. Change the properties of the newly imported commands (they will be set to the Make Dragon Commands application) to specify the actual specific application you want (the program should be running to show up in the drop-down list). When you are all done, 5. GO into the application and say "What Can I Say" to see your commands. 6. Have fun! Send me your email by pm and let's see if it helps you . . . -------------------------
|
|||||||||||
|
|||||||||||
![]() |
|||||||||||
I also wrote a script which does almost exactly what PG's does - writes an XML file which is then imported into KnowBrainer. I went the route of hard-coding the application specific detail into the script so the script had to be changed for each application. I also hard-coded the iterations (number of commands be created) as it was easier than writing the code to "keep doing until EOF". I also did not bother to write code to open a (text) file for input and another for output; I just had the input text file open in a text editor on the left side of the screen and the output XML file open in a text editor on the right side of the screen. I would make sure that I started out with the text cursor on the first line of the input file and a blank line immediately after the XML header of the output file, then, using basic commands like ------------------------- -Edgar |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
I use a spreadsheet application (e.g. Excel) to prepare the information for the input file. Typically, what you copied from the web will be a table which can be pasted directly into the spreadsheet with the description in one column and the actual shortcut in another column. This is fairly easy to edit - especially the description which needs to be massaged to become the command name. Select all the shortcuts and descriptions in the spreadsheet, copy them, then paste the result into a text file (I use PSPad as my text editor here - it makes it easy to replace the tabs between the shortcut and the description (which is what happens when you paste a table from a spreadsheet into a plain text editor); I would probably use a semi-colon as my separator but you could probably leave the tab and separate the line on it. It also conveniently numbers the lines so I know exactly how many iterations I need.
------------------------- -Edgar |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
These commands are already in KnowBrainer: Ctrl+D = Bookmark This Page Ctrl+E = We just added Search but you have much better options. Try saying Search for <Lunis Star Trek> and click the 2nd link if you get bored. HOWEVER, our favorite search command is Google for <dictation> which we prefer over the other options. Ctrl+F = Find On Page but why waste time when you can say Find <KnowBrainer> and save a step. Ctrl+G ~ OK, you stumped the chump on this 1 so we just added Next Match to <%> KB Build 2-14-2020, which is available now.
Creating these types of KnowBrainer commands with VerbalBasic couldn't be easier. Since KnowBrainer already has a Microsoft Edge application specific Bookmark This Page command, try creating a Microsoft Edge application specific Bookmark command via the following blazing fast 2 steps: 1. Say New App Command <bookmark> (do not touch your mouse under penalty of law) 2. Say Send Keys <Control Delta> Out to add the SendKeys "^d" script (Press Ctrl+D) and simultaneously save your command. That is notably faster to create than a Dragon step-by-step macro and will also deploy faster. Note #1: If you do not know your NATO phonetic alphabet, you can substitute by saying Send Keys <Control Dee> Out or leave out the word “Out” so that you can preview your command before saving... which is so last year Note #2: We recommend against prefixing KnowBrainer commands with additional words like “puff” because it really shouldn't be necessary. You will occasionally experience a misfire but it shouldn't happen very often. We are continuously working on preventing accidental KnowBrainer command deployment by editing command names and in some cases, removing. PS: We will be releasing a more complete Build of KnowBrainer on Monday so that if you choose, you can leave the word “command” out of your verbal macro building commands. However, we have to test before releasing. We will also be adding additional Open <dictation> commands like Open <System>, <Settings>, <Search> and <Run>
------------------------- Forum Mission Statement |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
Also note that if you would prefer to execute KnowBrainer commands from within Dragon, you can copy most KnowBrainer commands into Dragon as Advanced-Scripting commands. Dragon and KnowBrainer support the same VB language. A few KnowBrainer commands cannot be copied because we are using VB+ (our term for additional perks) ------------------------- Forum Mission Statement |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
Ag, that was a great idea - a script to generate XML commands from an input file. It should be very easy for you to do that in Emacs (almost just a keyboard macro). And PG and Edgar (and maybe other people too) have seen the same need. My idea was to walk the controls and buttons and menus of an app, pull out the keybindings, and generate an XML file for Dragon (or whatever). I imagine one day that someone will write an integrated set of all these little tools to solve all the little problems in one go. But until it's worthwhile for someone to do that for sales or altruism, we'll all be stuck with homebrew solutions.
------------------------- Win10/x64, AMD Ryzen 7 3700X, 64GB RAM, Dragon 15.3, SP 6 PRO, SpeechStart, Office 365, KB 2017, Dragon Capture, Samson Meteor USB Desk Mic, Klim and JUKSTG earbuds with microphones, 3 BenQ 2560x1440 monitors, Microsoft Sculpt Keyboard and fat mouse |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
Don't forget that many applications' menus and controls do not have direct keyboard shortcuts but do have ALT-key accelerator keys. When I write an application I ensure that all menu commands have both and that all controls (which can't have keyboard shortcuts) with text labels have accelerator keys.
------------------------- -Edgar |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
I find creating lots and lots of scripts automatically, means inevitably you forget they exist.
My approach is to create them using KnowBrainer, which is quite quick anyway, as and when I need them.
Please see the following video as an example:
------------------------- Thanks Mark
Dragon Professional Advanced Scripting/KnowBrainer Scripts |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
Agreed. That is why my utility creates an application-specific "What Can I Say" Dragon command. -------------------------
|
|||||||||||
|
|||||||||||
![]() |
|||||||||||
And why when I developed KnowBrainer I included a sidebar that tells you which commands are available for which application/window and which commands are available globally. I would certainly also endorse Mark's XML parser written specifically for the KnowBrainer XML commands file as it lays out the XML file with a very neat UI. ------------------------- |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
Where/what is "Mark's XML parser for the KnowBrainer XML commands..."?
I'm hoping that you're going to tell me it provides ways to sort and group the KnowBrainer commands. It is rather hard to see patterns in the KnowBrainer sidebar. ------------------------- DPG15.6 (also DPI 15.3) + KB, Sennheiser MB Pro 1 UC ML, BTD 800 dongle, Windows 10 Pro, MS Surface Book 3, Intel Core i7-1065G7 CPU @ 1.3/1.5GHz (4 cores, 8 logical, GPU=NVIDIA Quadro RTX 3000 with Max-Q Design. |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
Please see the following link (within the solution there is a project called browse scripts) ------------------------- Thanks Mark
Dragon Professional Advanced Scripting/KnowBrainer Scripts |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
Believe me, I create a lot of scripts using KnowBrainer. Too many. I need to generate them in order to become more consistent. I find when I create scripts by hand their names are inconsistent and I find it harder to remember them. ------------------------- DPG15.6 (also DPI 15.3) + KB, Sennheiser MB Pro 1 UC ML, BTD 800 dongle, Windows 10 Pro, MS Surface Book 3, Intel Core i7-1065G7 CPU @ 1.3/1.5GHz (4 cores, 8 logical, GPU=NVIDIA Quadro RTX 3000 with Max-Q Design. |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
I can understand the part about giving all menu items keyboard shortcuts, but I don't understand exactly what you mean by "controls with text labels" having accelerator keys. I tried making a little Windows Form with label="N&ame" beside a textbox. When I spoke "Name", dragon did something to show the underlined _a_ in Name, but it didn't click the label. If I clicked the label it jumped into my click event handler and I could put the focus into the adjoining text box. But a click was required.
Is there any coding way to have Dragon force the focus (invoke an event handler) when I speak the name of a label on a form? I've tried but failed (sigh). ------------------------- Win10/x64, AMD Ryzen 7 3700X, 64GB RAM, Dragon 15.3, SP 6 PRO, SpeechStart, Office 365, KB 2017, Dragon Capture, Samson Meteor USB Desk Mic, Klim and JUKSTG earbuds with microphones, 3 BenQ 2560x1440 monitors, Microsoft Sculpt Keyboard and fat mouse |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
Make sure that the textbox comes next after the label in the tab order. -------------------------
|
|||||||||||
|
|||||||||||
![]() |
|||||||||||
Wow, that worked - thank you! But I don't know _why_ it worked. First I had to put the label *in* the tab stop order, and then I aligned it in sequence as you describe. Does this mean Dragon receives my utterance, matches it to the label, and then sends a TAB command to the form to move it to the next field in TabStop order?
------------------------- Win10/x64, AMD Ryzen 7 3700X, 64GB RAM, Dragon 15.3, SP 6 PRO, SpeechStart, Office 365, KB 2017, Dragon Capture, Samson Meteor USB Desk Mic, Klim and JUKSTG earbuds with microphones, 3 BenQ 2560x1440 monitors, Microsoft Sculpt Keyboard and fat mouse |
|||||||||||
|
|||||||||||
![]() |
|||||||||||
I find creating lots and lots of scripts automatically, means inevitably you forget they exist.
|
|||||||||||
|
|||||||||||
![]() |
|||||||||||
well, I am quite happy with my baby steps towards creating a whole bunch of speech commands corresponding to tables of keyboard shortcuts Such as are published for nearly all apps
BTW the ugly indentation is largely an artifact of AutoHotKey's syntax for continuing statements across multiple lines. Combined with an incomplete emacs AHK-mode.
Eventually I hope to get it to a single line per command ctx := Recognizer().set_context(""- Google Docs - Google Chrome") ctx.add( { keys: "^+h", regex: re_wrap("help menu") } ) or ctx.add( [ "comment: begin"", always trying to make it look as close as possible to the tables one season help webpages
---
BTW ++: I find it more pleasant to make actual running code look like the table of keyboard shortcuts and commands, then to take such a table in a data structure like CSV and generate code. Because in the latter case when you're debugging the code you have to go back and fix the original table and then regenerate, or, if you fix a bug in the generated code, you risk losing it if you regenerate. It's like code wizards, which are a well-known way of quickly creating a lot of code that is hard to upgrade and maintain.
------------------------- DPG15.6 (also DPI 15.3) + KB, Sennheiser MB Pro 1 UC ML, BTD 800 dongle, Windows 10 Pro, MS Surface Book 3, Intel Core i7-1065G7 CPU @ 1.3/1.5GHz (4 cores, 8 logical, GPU=NVIDIA Quadro RTX 3000 with Max-Q Design. |
|||||||||||
|
FuseTalk Standard Edition v4.0 - © 1999-2021 FuseTalk™ Inc. All rights reserved.