KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Is it better to have one command with several variables and longer lists, or multiple commands with fewer?
Topic Summary:
Created On: 08/23/2021 11:22 AM
Status: Post and Reply
Linear : Threading : Single : Branch
Keyword
 08/23/2021 11:22 AM
User is offline View Users Profile Print this message

Author Icon
wristofdoom
Top-Tier Member

Posts: 244
Joined: 09/03/2020

Sometimes I create multiple custom commands without a variable, and other times I consolidate multiple commands into a single command with many different cases.

 

I'm wondering if there is a recognition or speed (dis)advantage to having commands separated out into many commands, or having them consolidated into a single command with several lists.

 

Here's an example command that has many different cases, some more similar than others. Would you break this up into multiple commands?

 

 

 Command name="[md] [markdown_limited]"  

If ListVar1 = "new MD" Then SendKeys "{Enter 2}"

Select Case ListVar2

Case "italics"

SendKeys "**{left}"

Case "bold"

SendKeys "****{left 2}"

Case "bold paste"

SendKeys "**^v**"

Case "strikethrough", "strike"

SendKeys "{~}{~}{~}{~}{left 2}"

Case "underline"

SendKeys "__{left}"

Case "code"

SendKeys "```~~~```~"

Wait 0.1

SendKeys "{up 3}"

Case "code paste"

SendKeys "```~^v~~```~"

Case "link"

SendKeys "[]{(}^v{)}"

Case "italics paste"

SendKeys "*^v*"

Case "wiki paste"

SendKeys "[[^v]]"

Case "highlight paste"

SendKeys "==^v=="

End Select

End Sub 

 

 

Lists: 

List name="md"

MD

new MD 

 

List name="markdown_limited"

bold

bold paste

code

code paste

highlight

highlight paste

italics

italics paste

link

strike

strikethrough

strong

underline

wiki

wiki paste 



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

Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017.



 08/23/2021 12:36 PM
User is offline View Users Profile Print this message

Author Icon
kkkwj
Top-Tier Member

Posts: 831
Joined: 11/05/2015

I'm no expert on Dragon lists, but I don't see anything to worry about in your code. Both lists are small (under 100 items, for example), and only two lists are in the command itself. I would say carry on in that style. If you create separate commands for each style (bold, code, strong, strike, etc) you'll have many more commands to pollute your spoken namespace, many more commands to worry about remembering, and many more commands for Dragon to load and search at runtime. As you collect more commands over time, all these things will become more important. I think Edgar, Ag, and me all use a single prefix for all/many/most of our custom commands these days for all the reasons listed above.

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

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

 08/23/2021 01:38 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 4183
Joined: 12/08/2007

I don't know whether there is a speed penalty when using list commands. But I generally prefer them because the scripts are easier to maintain.

In Version 12 or 13, Dragon's performance suffered when lists were very long. I don't think it's still an issue. Your list is relatively short -- fewer than 20 items -- so I don't think you'll notice any performance problems.

But... consider changing the first word to something that is not a list. My experience, when I was doing this a lot, was that custom commands were more likely to trigger inadvertently.
 08/24/2021 03:01 PM
User is offline View Users Profile Print this message

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 455
Joined: 08/09/2018

I haven't noticed any sort of performance hit using list commands. Like Alan Cantor, I generally prefer them, principally for maintenance reasons.
 08/24/2021 06:30 PM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 1202
Joined: 04/03/2009

I'm with Matt and Alan here. I have one list with over five thousand items!

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

-Edgar
DPI 15.3, 64-bit Windows 10 Pro, OpenOffice & Office 365, Norton Security, Shure X2U XLR to USB mic adapter with Audio Technica DB135 vocal mic, Asus X299-Deluxe Prime, Intel Core i9-7940X (14 core, 4.3 GHz overclocked to 4.9 GHz), G.SKILL TridentZ Series 64GB (4 x 16GB) DDR4 3333 (PC4 26600) F4-3333C16Q-64GTZ, NVIDIA GIGABYTE GeForce GTX 1060 GV-N1060G1 GAMING-6GD REV 2.0 6GB graphics card with 3 1920x1080 monitors

 12/06/2021 02:23 PM
User is offline View Users Profile Print this message

Author Icon
Tomc
Junior Member

Posts: 33
Joined: 10/14/2019

I am a novice at writing list commands. Is there a thread, video, or webpage that would walk me through creating one?
 12/06/2021 03:39 PM
User is offline View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 39368
Joined: 10/01/2006

1. In our opinion the best manual approach is late Larry Allen's Scripting for Dragon

2. Our 2nd favorite choice is the VerbalBasic chapter in the KnowBrainer 2020 command utility which teaches you to write commands verbally. Verbal command writing is easier and minimally 10 times faster



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

Change "No" to "Know" w/KnowBrainer 2020
Trial Downloads
Dragon/Sales@KnowBrainer.com 
(615) 884-4558 ex 1

 12/06/2021 04:16 PM
User is offline View Users Profile Print this message

Author Icon
Tomc
Junior Member

Posts: 33
Joined: 10/14/2019

Thanks for the reply. Those look like two very good resources, but I am on a limited income and was looking for something free of charge. I appreciate the answer, though.

 12/06/2021 07:50 PM
User is offline View Users Profile Print this message

Author Icon
wristofdoom
Top-Tier Member

Posts: 244
Joined: 09/03/2020

Originally posted by: Tomc Thanks for the reply. Those look like two very good resources, but I am on a limited income and was looking for something free of charge. I appreciate the answer, though.

 

 

I learned everything I know about Dragon commands on this forum for free. My recommendation is to keep digging through posts, try out the commands that other people post, figure out how they work.



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

Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017.

 12/06/2021 05:15 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 4183
Joined: 12/08/2007

Think of Larry Allen's book as an investment. Over the years, his book has saved me dozens of hours of slog work -- probably hundreds.

The alternative is to search for answers to questions on lists on this forum, or to ask your own questions.

But you may discover that spending 30 minutes reading Larry's chapter on list commands will get you further, faster.
Statistics
32177 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 318 guests browsing this forum, which makes a total of 318 users using this forum.

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