KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: change Dragon options for a particular program only
Topic Summary: Would like to have "click" to select menus and buttons configured differently for different programs
Created On: 10/02/2020 11:13 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 change Dragon options for a particular program only   - Anandits - 10/02/2020 11:13 PM  
 change Dragon options for a particular program only   - R. Wilke - 10/03/2020 05:27 AM  
 change Dragon options for a particular program only   - dilligence - 10/03/2020 03:28 PM  
 change Dragon options for a particular program only   - PG LTU - 10/03/2020 01:53 PM  
 change Dragon options for a particular program only   - R. Wilke - 10/03/2020 04:31 PM  
 change Dragon options for a particular program only   - kkkwj - 10/03/2020 04:56 PM  
 change Dragon options for a particular program only   - R. Wilke - 10/03/2020 06:04 PM  
 change Dragon options for a particular program only   - dilligence - 10/04/2020 10:38 AM  
 change Dragon options for a particular program only   - PG LTU - 10/03/2020 05:12 PM  
 change Dragon options for a particular program only   - R. Wilke - 10/03/2020 06:02 PM  
 change Dragon options for a particular program only   - R. Wilke - 10/04/2020 01:27 PM  
 change Dragon options for a particular program only   - PG LTU - 10/04/2020 02:38 PM  
 change Dragon options for a particular program only   - R. Wilke - 10/04/2020 03:07 PM  
 change Dragon options for a particular program only   - dilligence - 10/04/2020 04:55 PM  
 change Dragon options for a particular program only   - R. Wilke - 10/05/2020 11:48 AM  
 change Dragon options for a particular program only   - dilligence - 10/05/2020 03:11 PM  
 change Dragon options for a particular program only   - Edgar - 10/04/2020 02:48 PM  
 change Dragon options for a particular program only   - Anandits - 10/05/2020 01:14 AM  
 change Dragon options for a particular program only   - dilligence - 10/05/2020 09:19 AM  
 change Dragon options for a particular program only   - R. Wilke - 10/05/2020 11:46 AM  
 change Dragon options for a particular program only   - Anandits - 10/05/2020 11:04 PM  
 change Dragon options for a particular program only   - Mav - 10/06/2020 05:30 AM  
 change Dragon options for a particular program only   - Matt_Chambers - 10/06/2020 08:21 AM  
 change Dragon options for a particular program only   - R. Wilke - 10/06/2020 06:22 PM  
 change Dragon options for a particular program only   - Mav - 10/07/2020 02:27 AM  
 change Dragon options for a particular program only   - R. Wilke - 10/07/2020 02:50 AM  
 change Dragon options for a particular program only   - Alan Cantor - 10/08/2020 11:59 AM  
 change Dragon options for a particular program only   - Anandits - 10/09/2020 05:25 AM  
 change Dragon options for a particular program only   - PG LTU - 10/08/2020 01:23 PM  
 change Dragon options for a particular program only   - Alan Cantor - 10/08/2020 02:57 PM  
 change Dragon options for a particular program only   - Matt_Chambers - 10/08/2020 05:54 PM  
 change Dragon options for a particular program only   - Alan Cantor - 10/09/2020 10:04 AM  
 change Dragon options for a particular program only   - dilligence - 10/16/2020 10:05 AM  
 change Dragon options for a particular program only   - PG LTU - 10/16/2020 05:41 PM  
 change Dragon options for a particular program only   - dilligence - 10/16/2020 07:51 PM  
Keyword
 10/03/2020 05:27 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7279
Joined: 03/04/2007

There is no such option. In order to prevent "this constantly causing unwanted things to happen", I would strongly suggest setting the option to require "click". It may seem less elegant, but you will get used to it, and in the long run it will pay to go the extra mile.

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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage

 10/03/2020 03:28 PM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1158
Joined: 08/16/2010

Awesome script PG!

 

Anandits, for SP you will need this slightly edited version:

 

Sub Main

    EngineControl.Option(dgnengoptionRequireClickToSelectControls) = Not EngineControl.Option(dgnengoptionRequireClickToSelectControls) ' require click for controls

    EngineControl.Option(dgnengoptionRequireClickToSelectMenus) = Not EngineControl.Option(dgnengoptionRequireClickToSelectMenus) ' require click for menus

End Sub



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

www.speechproductivity.eu 


Fast Add-ons for Dragon Professional - Easy Guide to Dragon Scripting



 10/03/2020 01:53 PM
User is offline View Users Profile Print this message

Author Icon
PG LTU
Top-Tier Member

Posts: 2100
Joined: 03/21/2007

I've shown how easy it is to write a command to toggle or change most Dragon options easily without traversing the DragonBar or any menus. The one in mind is no different.

Pls see here: http://www.knowbrainer.com/forums/forum/messageview.cfm?catid=12&threadid=34732

Sub Main
    ' Command Name "Toggle Require Clicks" (toggles Dragon option settings)
    EngineControl.Option(dgnengoptionRequireClickToSelectControls) = Not EngineControl.Option(dgnengoptionRequireClickToSelectControls) ' require click for controls
    EngineControl.Option(dgnengoptionRequireClickToSelectLinksInIE) = Not EngineControl.Option(dgnengoptionRequireClickToSelectLinksInIE) ' require clicks in browsers
End Sub


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.



 10/03/2020 04:31 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7279
Joined: 03/04/2007

PG, sure the Dragon API allows for accessing the engine options programmatically, and if you have studied my Dragon sources options code, initially published as an Advanced Scripting, while I was still publishing such, you certainly got the idea. And by mentioning this, I don't mean to start yet another silly discussion as to who first discovered and brought it up, since the API is open source anyhow, so who cares.

So there is probably nothing really awesome about it, and I wouldn't actually call it awesome really, no matter how mind boggling the less talented among us might find it.

Anyway, it doesn't solve the OP question with regards to setting it application specific, because it can't be set like this.

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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage

 10/03/2020 04:56 PM
User is offline View Users Profile Print this message

Author Icon
kkkwj
Top-Tier Member

Posts: 512
Joined: 11/05/2015

Anandits, as others have said already, there's no way to tell Dragon to leave the options on for some programs and off for others. The only way for you to achieve that goal is to define your own commands (one for each menu that Dragon can see, or at least for the ones that are causing you trouble.) Then your code could inspect the foreground window and then do the flip (call PG's code) or not according to your preferences, depending on the value of the foreground window.


I could be wrong, but getting the value of the foreground window should be easier in the new WinWrap Basic in v15.6 if it allows you to call the .NET libraries. (15.3 using Sax(?) Basic didn't allow you to do that.) Lunis, please speak up if my assumption about 15.6 is wrong, thank you.

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

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

 10/03/2020 06:04 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7279
Joined: 03/04/2007

I could be wrong, but getting the value of the foreground window should be easier in the new WinWrap Basic in v15.6 if it allows you to call the .NET libraries. (15.3 using Sax(?) Basic didn't allow you to do that.) Lunis, please speak up if my assumption about 15.6 is wrong, thank you.

 

You could always implement and bind to Win32 API functions, therefore, 15.6 should not be that much of a game changer. However, the problem isn't with calling the function, but with automating the task of "watching windows as they come and go" reliably.


It still stands that, rather than risking "unwanted things happening", and if it really troubles you, it is better to play safe by setting the option to require saying "click", no matter what he has to say. I admit that it took me years to find out also.



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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage



 10/04/2020 10:38 AM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1158
Joined: 08/16/2010

Thanks to Philip ((C) 2020 PG Service) for kindly allowing us to add the EngineControl.Option Advanced Scripting commands to the next SP update, you can now "virtually" turn Require "Click" ON or OFF (Boolean) per SP application (if required).

 

Here are two sample commands using SP Plates. The first command opens Plates and turns Require "Click" OFF:

 

 

 

 

 

 

 

 

 

The second closes Plates and turns Require "Click" back ON: 

 

 

 

 

 

 

 

 

Just copy this main code to create the two commands and add AppBringUp, SendSystemKeys and Wait (in seconds!) yourself for your own applications:

 

Sub Main

    EngineControl.Option(dgnengoptionRequireClickToSelectMenus) = False

    EngineControl.Option(dgnengoptionRequireClickToSelectControls) = False

End Sub

 

 

Sub Main

    EngineControl.Option(dgnengoptionRequireClickToSelectMenus) = True

    EngineControl.Option(dgnengoptionRequireClickToSelectControls) = True

End Sub



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

www.speechproductivity.eu 


Fast Add-ons for Dragon Professional - Easy Guide to Dragon Scripting



 10/03/2020 05:12 PM
User is offline View Users Profile Print this message

Author Icon
PG LTU
Top-Tier Member

Posts: 2100
Joined: 03/21/2007

Sure for that matter an AHK script could run in the background that does the toggle (or better yet, sets the state) upon a specific application becoming the Active Window and again toggles (or sets a new state) when it is no longer the active window.

 

Or just add it to your global "open the application" and "switch to the application" commands and then add the toggle back to to that application's "switch" and "close" commands.

 

And tbc this is basic api stuff and examples go back pretty far on the forum. I certainly did not originate it (and my work clearly stands on those shoulders).  I will claim to first noticing that creating a DgnEngineControl object is not required (as most people _still_ do) and the static enginecontrol class can often be be used directly for many of these things.



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




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.



 10/03/2020 06:02 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7279
Joined: 03/04/2007

I will claim to first noticing that creating a DgnEngineControl object is not required


Yes, you did that, and it did surprise me.

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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage

 10/04/2020 01:27 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7279
Joined: 03/04/2007

@dilligence

Since I am currently in a giving mood, and since you are in your usual copying and claiming mood again, infested by talky PG once more, who seems to be one of your everlasting sources of "inspiration", as far as things you would never even notice on your own, I just thought I would point out how "your new" integration could be made more professional, and thus more effective.

Real programmers make such things function as a toggle, so they don't need to set up two different commands. Now, there are many ways to program a toggle, and one of them would be, in pseudo code:

the current state = the current state of the option in question
the new state = the opposite to the current state

So as you can see, programming can be that easy and less involved if you get your head around the bigger picture. Alternatively, you can try getting your new programmer to work it out for you.



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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage



 10/04/2020 02:38 PM
User is offline View Users Profile Print this message

Author Icon
PG LTU
Top-Tier Member

Posts: 2100
Joined: 03/21/2007

Yes RĂ¼diger, in fact the main reason I bothered to post the original example (which concept as you noted was not original to me) was I was highlighting (self-aggrandizing - what else are we doing on forums?) and "pleased" about my specific expression which handles toggling or setting a specific option-state by a mixed list (minimizing the number of string manipulations) and my using a complex list for the options allowing for increased flexibility in adding additional available options (but not all are available check the API help). But anyway, you of all people certainly enjoyed that my example necessitated use of the Eval function to get there!

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




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.

 10/04/2020 03:07 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7279
Joined: 03/04/2007

Originally posted by: PG LTU Yes Rüdiger, in fact the main reason I bothered to post the original example (which concept as you noted was not original to me) was I was highlighting (self-aggrandizing - what else are we doing on forums?) and "pleased" about my specific expression which handles toggling or setting a specific option-state by a mixed list (minimizing the number of string manipulations) and my using a complex list for the options allowing for increased flexibility in adding additional available options (but not all are available check the API help). But anyway, you of all people certainly enjoyed that my example necessitated use of the Eval function to get there!

 

PG, we talked about it yesterday, via email. As far as I am concerned, you are the current Advanced Scripting hero in this place, and it would be hard to beat you. Rest assured that I wouldn't even try to compete with you any longer.

But, please reconsider your habit of giving it all away here, since there are so many free riders around this place stealing and making it part of their business portfolio, thus taking advantage of it in ways you probably didn't mean it to be, where dilligence is just the tip of the iceberg, and one of the worst kind at that.

Basically, you don't have to prove that you are the king of the hill in scripting by posting them any longer. In my book, you are already.

 

 

 



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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage

 10/04/2020 04:55 PM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1158
Joined: 08/16/2010

Wilke,

 

The obvious success of SP 6 PRO must be a bitter pill for you. And your libelous responses, such as these, were to be expected of course.

 

But being all bitter and twisted about it is not going to help anyone. Least of all, yourself. Let's also not forget that people always spot a sore loser when they see one.

 

It would be wiser to just take it like a man (we all know life's hard sometimes).

 

Btw, as Edgar clearly pointed out, the toggling approach is most definitely inadequate in this situation (I found out as well because I tried that initially). 



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

www.speechproductivity.eu 


Fast Add-ons for Dragon Professional - Easy Guide to Dragon Scripting



 10/05/2020 11:48 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7279
Joined: 03/04/2007

Wilke,

 

The obvious success of SP 6 PRO must be a bitter pill for you. 

 

Dilligence, only in your dreams.

 



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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage

 10/05/2020 03:11 PM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1158
Joined: 08/16/2010

Ha, ha. Well, we'll let the people decide for themselves



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

www.speechproductivity.eu 


Fast Add-ons for Dragon Professional - Easy Guide to Dragon Scripting

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

Author Icon
Edgar
Top-Tier Member

Posts: 939
Joined: 04/03/2009

Toggles can be good in a GUI where the current state is obvious. However, where the state is not obvious (especially when being manipulated with a script) it's imperative to be able to set the state explicitly. Think of "Wake Up" and "Go To Sleep" - if the microphone is asleep and you say/script "Go To Sleep" Dragon just ignores it; conversely, if awake and you say/script "Wake Up" Dragon again ignores it. If the ONLY command you had was "toggle microphone" things would get ugly in a hurry.

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

-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

 10/05/2020 01:14 AM
User is offline View Users Profile Print this message

Author Icon
Anandits
Senior Member

Posts: 125
Joined: 03/25/2019

I very much appreciate the help I am getting through this forum, and being someone "less talented", I am very grateful for other people's help in resolving my problems!


Thank you everybody for your advice, and I will try out these suggestions. (By the way, I am using Dragon 15.3, the updated version has not come out for my language version yet).

 10/05/2020 09:19 AM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1158
Joined: 08/16/2010

Anandits,

 

AVT heeft de NL versie al:

 

https://spraakherkenning.nl/update-nu-uw-dragon-professional-15-gratis-naar-versie-15-6/

 

Direkte link:

 

https://we.tl/t-fusvjileLU



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

www.speechproductivity.eu 


Fast Add-ons for Dragon Professional - Easy Guide to Dragon Scripting



 10/05/2020 11:46 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7279
Joined: 03/04/2007

and being someone "less talented"

 

Anandits, that wasn't directed at you, by all means.



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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage



 10/05/2020 11:04 PM
User is offline View Users Profile Print this message

Author Icon
Anandits
Senior Member

Posts: 125
Joined: 03/25/2019

Originally posted by: R. Wilke
and being someone "less talented"

 

 

 

Anandits, that wasn't directed at you, by all means.

 

 

Good to know :-). No offense taken.
I am sorry that this post caused so much distress here and there! I hope that everybody will be reconciled and be able to speak politely and respectfully to each other. Cheering you all on!

 10/06/2020 05:30 AM
User is online View Users Profile Print this message

Author Icon
Mav
Top-Tier Member

Posts: 235
Joined: 10/02/2008

Sorry that this discussion derailed like this because some members don't know how to behave and take their frustration out on others.

@R.Wilke and @diligence:

Please keep your attacks off this forum.

For users seeking help it really doesn't matter whoever came up with the idea for a better dictation box first. Since the Dragon SDK is so easily available, it's not the rocket science you both want to make it look like.

If anyone has a substantial claim or patent on anything he's free to sue the other party.
If not, please stfu.

mav

 10/06/2020 08:21 AM
User is offline View Users Profile Print this message

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 272
Joined: 08/09/2018

Originally posted by: Mav Sorry that this discussion derailed like this because some members don't know how to behave and take their frustration out on others.

 

@R.Wilke and @diligence:

 

Please keep your attacks off this forum.

 

For users seeking help it really doesn't matter whoever came up with the idea for a better dictation box first. Since the Dragon SDK is so easily available, it's not the rocket science you both want to make it look like.

 

If anyone has a substantial claim or patent on anything he's free to sue the other party. If not, please stfu.

 

mav

 

I completely agree.

 10/06/2020 06:22 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7279
Joined: 03/04/2007

Please keep your attacks off this forum.

 

Mav, no argument about that. But a few minor corrections as to the below, and just for your information.

 

For users seeking help it really doesn't matter whoever came up with the idea for a better dictation box first. Since the Dragon SDK is so easily available, it's not the rocket science you both want to make it look like.

 

Not sure what the disagreement above had to do with dictation boxes. It is rather just a very personal thing going on between the two of us, and might as well have been started over something completly unrelated.

 

Plese note that I don't use the SDK in DragonCapture, and also not in some other apps I created. And I think I never made it look like it is rocket science, or else free to point me to it.

 

If anyone has a substantial claim or patent on anything he's free to sue the other party.

 

No chance that this will happen, in case you are referring to DragonCapture, because the concept I use in this is totally different from the "classical" dictation box as well as its replication.



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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage



 10/07/2020 02:27 AM
User is online View Users Profile Print this message

Author Icon
Mav
Top-Tier Member

Posts: 235
Joined: 10/02/2008

I really don't care how DragonCapture or SP work and which APIs they use.

If one of you accuses the other one of stealing, that's a pretty severe accusation and you'd better have proof before making such a claim.

 

All of this got nothing to do with the question at hand or any question in this forum, so please just stop replying and trying to justify yourself - all you achieve is to annoy the rest of the members here and embarrass yourself.

 

That's the last I'll add to this thread and hope Lunis will make it readable again by removing all the unrelated postings.

 10/07/2020 02:50 AM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 7279
Joined: 03/04/2007

I really don't care how DragonCapture or SP work and which APIs they use.


It was you who brought it up.

All of this got nothing to do with the question at hand or any question in this forum


This is absolutely correct, and it had better been left unsaid.

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



No need to buy if all you want to do is try ...

DragonCapture KB Download (Latest)
DragonCapture Homepage

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


Alan Cantor
Top-Tier Member

Posts: 3869
Joined: 12/08/2007

Not wanting to wade into the clashes that this topic has generated, I still would like to share my version of a single command to toggle between requiring and not requiring the word "click."

In the spirit of offering a treasure trove of resources for Dragon users present and future, and of improving our understanding of ways to use Dragon to advantage, I welcome anyone to modify the script and post your code. I'm not a professional programmer, and I'm sure there are ways to make the script better.

When I first made it, I included message boxes to signal the status of the Dragon options. But I commented them out, as in actual use, when I discover the Dragon click settings are "wrong," I simply say the command to make things right. So I don't think feedback about the status is essential.

Sub Main
If EngineControl.Option(dgnengoptionRequireClickToSelectMenus) = False Then
    With EngineControl
       .Option(dgnengoptionRequireClickToSelectMenus) = True
       .Option(dgnengoptionRequireClickToSelectControls) = True
    End With
' MsgBox "Start menu and control commands with " & Chr(34) & "click" & Chr(34) & " enabled"
Else
    With EngineControl
       .Option(dgnengoptionRequireClickToSelectMenus) = False
       .Option(dgnengoptionRequireClickToSelectControls) = False
    End With
' MsgBox "Start menu and control commands with " & Chr(34) & "click" & Chr(34) & " disabled"
End If
End Sub

My command is called "Toggle Clicks" but of course you can call it anything you want. A slightly longer name might help reduce the likelihood of accidentally triggering, maybe something like "Toggle Starting Clicks."



 10/09/2020 05:25 AM
User is offline View Users Profile Print this message

Author Icon
Anandits
Senior Member

Posts: 125
Joined: 03/25/2019

Originally posted by: Alan Cantor Not wanting to wade into the clashes that this topic has generated, I still would like to share my version of a single command to toggle between requiring and not requiring the word "click." In the spirit of offering a treasure trove of resources for Dragon users present and future, and of improving our understanding of ways to use Dragon to advantage, I welcome anyone to modify the script and post your code. I'm not a professional programmer, and I'm sure there are ways to make the script better. When I first made it, I included message boxes to signal the status of the Dragon options. But I commented them out, as in actual use, when I discover the Dragon click settings are "wrong," I simply say the command to make things right. So I don't think feedback about the status is essential. Sub Main If EngineControl.Option(dgnengoptionRequireClickToSelectMenus) = False Then     With EngineControl        .Option(dgnengoptionRequireClickToSelectMenus) = True        .Option(dgnengoptionRequireClickToSelectControls) = True     End With ' MsgBox "Start menu and control commands with " & Chr(34) & "click" & Chr(34) & " enabled" Else     With EngineControl        .Option(dgnengoptionRequireClickToSelectMenus) = False        .Option(dgnengoptionRequireClickToSelectControls) = False     End With ' MsgBox "Start menu and control commands with " & Chr(34) & "click" & Chr(34) & " disabled" End If End Sub My command is called "Toggle Clicks" but of course you can call it anything you want. A slightly longer name might help reduce the likelihood of accidentally triggering, maybe something like "Toggle Starting Clicks."

 

Hello Alan, I created this script and it works very nicely, thank you. Is there something I can do to get these message boxes come up? Because I would like that, in order to not lose my way and remember what is what.

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

Author Icon
PG LTU
Top-Tier Member

Posts: 2100
Joined: 03/21/2007

I don't see the value in checking the state and setting it to the opposite when you can simply set any state to its opposite as shown by me and Rob above using "Not" (meaning set it to not the current state).

You could also have an entire array of options, and go ahead and toggle each one with a "for each item in array" construct:
Sub Main
    Dim opts, opt
    opts = Array("dgnengoptionRequireClickToSelectControls", _
                 "dgnengoptionRequireClickToSelectLinksInIE", _
                 "dgnengoptionRequireClickToSelectMenus")

    For Each opt In opts
        EngineControl.Option(Eval(opt)) = Not EngineControl.Option(Eval(opt))
    Next
End Sub

 

And, back to the question of setting specific options to specific values, for example, setting the auto-hide delay amount in seconds, try the following (noting that 1 = True and 0 = False):

Sub Main

    Dim opts, opt
    opts = Array("dgnengoptionRequireClickToSelectControls\1", _
                 "dgnengoptionRequireClickToSelectLinksInIE\0", _
                 "dgnengoptionRequireClickToSelectMenus\1", _
                 "dgnengoptionResultsBoxAutoHideDelaySec\7") ' set to 7 secs

    For Each opt In opts
        EngineControl.Option(Eval(Left(opt,InStr(opt,"\")-1))) = Mid(opt,InStr(opt,"\")+1)
    Next
End Sub

 

 

 

Of course, all this is just for fun and edification, enjoy!



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




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.



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


Alan Cantor
Top-Tier Member

Posts: 3869
Joined: 12/08/2007

I didn't know one could use "Not" that way!

I've been on this forum for 13 years, and I still learn stuff.
 10/08/2020 05:54 PM
User is offline View Users Profile Print this message

Author Icon
Matt_Chambers
Top-Tier Member

Posts: 272
Joined: 08/09/2018

Originally posted by: Alan Cantor I didn't know one could use "Not" that way! I've been on this forum for 13 years, and I still learn stuff.

Me either.  Very cool.

 10/09/2020 10:04 AM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 3869
Joined: 12/08/2007

If you want the message boxes, open the script in the Command Browser, delete the single quote marks from the start of the two lines that begin with the word "MsgBox", and save the command.

In other words, change the lines that begin like this:

' MsgBox "Start menu...

to this:

MsgBox "Start menu...


I found the message boxes intrusive as they need to be closed. There are other ways to signal that the action has been performed. For example, you could substitute

Beep

for one of the message boxes. For the other, these three instructions should cause the speaker to beep twice:

Beep
Wait .5
Beep
 10/16/2020 10:05 AM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1158
Joined: 08/16/2010

PG,

 

I tried the EngineControl.Option (Boolean) approach with Enable multiple text matches as well. But couldn't get it to work. Any ideas? 



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

www.speechproductivity.eu 


Fast Add-ons for Dragon Professional - Easy Guide to Dragon Scripting

 10/16/2020 05:41 PM
User is offline View Users Profile Print this message

Author Icon
PG LTU
Top-Tier Member

Posts: 2100
Joined: 03/21/2007

What is the constant name or number? I am not aware that is available through the static EngineControl object (did you try instantiating a new stand alone class? Not that I imagine it's available there either). If you look through the ini files for where that option is tracked, you might be able to address it that way (or get a hint at the constant name) or try different numbers by brute force . . .

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




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.

 10/16/2020 07:51 PM
User is offline View Users Profile Print this message

Author Icon
dilligence
Top-Tier Member

Posts: 1158
Joined: 08/16/2010

No there probably isn't :-(. I tried:

 

EngineControl.Option(dgnengoptionEnableMultipleTextMatches) = True

 

and some variations, but to no avail. No hints in the ini file either...

 

That leaves me with a simple DVC approach but that'll only work as a toggle:

 

HeardWord "open", "Dragon","options"

Wait 500

HeardWord "click","Commands"

Wait 200

SendKeys "{Tab}"

Wait 200

HeardWord "click","Enable","multiple","text","matches"

Wait 500

HeardWord "click","OK"

 

If anybody has a better idea please share it. I frequently want to turn this feature on and off (without any distractions).



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

www.speechproductivity.eu 


Fast Add-ons for Dragon Professional - Easy Guide to Dragon Scripting

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

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