![]() |
KnowBrainer Speech Recognition | ![]() |


|
Topic Title: simple command line application to run a DNS script Topic Summary: Created On: 07/15/2012 01:35 PM Status: Post and Reply |
|
![]() |
- mdl | - 07/15/2012 01:35 PM |
![]() |
- mdl | - 07/15/2012 01:40 PM |
![]() |
- mdl | - 07/15/2012 01:46 PM |
![]() |
- monkey8 | - 07/18/2012 09:11 AM |
![]() |
- mdl | - 07/18/2012 11:34 AM |
![]() |
- monkey8 | - 07/18/2012 07:24 PM |
![]() |
- mdl | - 07/18/2012 09:10 PM |
![]() |
- monkey8 | - 07/19/2012 08:02 AM |
![]() |
- maxr | - 07/22/2012 03:56 AM |
![]() |
- mdl | - 07/22/2012 01:20 PM |
![]() |
- mdl | - 07/25/2012 02:23 PM |
![]() |
- R. Wilke | - 07/25/2012 02:41 PM |
![]() |
- mdl | - 07/25/2012 08:56 PM |
![]() |
- maxr | - 07/25/2012 02:42 PM |
|
|
|||||
|
As an experiment, I tried playing with the DNS ActiveX controls using Visual Basic. Here is a simple console application, Exec_Script.exe, that takes one or more DNS scripting commands and executes them via the DNSTools.DgnVoiceCmd control. Sample invocation: Exec_Script.exe "HeardWord ""open"", ""DragonPad""" I assume it should be possible to use this plus say AutoHotkey to make keystrokes run DNS voice commands. Note that this version does not wait for the script to finish, returning immediately. I hope this will work with all editions of DNS, but if not please reply. - Mark
|
|||||
|
|
|||||
|
|
|||||
|
Below is the Visual Basic code for the application. I used Visual Studio 2010 express (free); choose console application, and add a reference to Dragon NaturallySpeaking ActiveX controls (under project->add reference->Com for me).
|
|||||
|
|
|||||
|
|
|||||
|
I forgot to mention that you can sequence several script commands by passing multiple arguments like so: Exec_Script.exe "Beep" "Wait 2000" "Beep" (This is the DNS scripting language which predates and is somewhat incompatible with the more modern Advanced Scripting; in particular, wait takes microseconds rather than the modern seconds and SendKeys does what SendDragonKeys does today. I believe KnowBrainer's verbal basic is using the same scripting language.)
|
|||||
|
|
|||||
|
|
|||||
|
mdl, What is the point of using a DgnVoiceCmd object to execute a script? We can execute scripts by a lot easier methods than that. Why don't you use it in the way it is meant to be used as an inbuilt Dragon command and not purely to execute a script. ------------------------- |
|||||
|
|
|||||
|
|
|||||
|
is there a better way to execute a DNS voice command from the command line? Please tell. I believe when people asked in the past how to make a voice command run when a key was pressed, the consensus was that the only method was to buy a utility that no one knew how worked.
|
|||||
|
|
|||||
|
|
|||||
|
Well it depends exactly what you want to do but if we take your exact example (using a DgnVoiceCmd) then yes there are better ways of implementing the commandline arguments. Using one commandline argument HeardWord is painfully slow and if you have a 50 line script having 50 commandline arguments, one for each line, is hardly practical. However my main point was that the DgnVoiceCmd is a far more powerful and flexible object when it isn't restricted to executing scripts, and yes there are other ways of executing script rather than using this object. ------------------------- |
|||||
|
|
|||||
|
|
|||||
|
I think we are not disagreeing. This was mostly an experiment, but I thought it might also be useful to the people that for whatever reason want to invoke one of their voice commands from the command line/via a keystroke.
|
|||||
|
|
|||||
|
|
|||||
|
I think using the ActiveX/COM objects within an executable with commandline parameters could be a good idea in certain instances, it's just that ExecuteScript has so many restrictions. Like what to do if the script is an advanced script with 20+ lines and COM object library references e.g. Microsoft Word object library. Also initially I thought you were just looking for ways to invoke voice commands using the various dragon API possibilities that you had discussed previously in your other thread, when in fact you were trying to do something more specific. You can't beat learning by doing, it's a never-ending process at least in my case. -------------------------
|
|||||
|
|
|||||
|
|
|||||
|
Very handy utility mdl. I like it. Keep up the good work.
Max Roth Dynamic Keyboard One for Naturally Speaking ------------------------- ErgoArchitect Assistive Technologies - ShowNumbers Plus! Addon to Naturally Speaking - www.ergoarchitect.com |
|||||
|
|
|||||
|
|
|||||
|
It worked for you? Good. I've only been able to test it on my Professional Edition. I'm curious if it works on non-professional editions. |
|||||
|
|
|||||
|
|
|||||
|
I just tried Exec_script.exe on another computer that didn't have Visual Studio installed and apparently it needs .NET v4 or something like that installed to run. Stupid Microsoft. Can't even build a standalone executable correctly . :-( That said, if you want to try it, I'm sure installing .net is fairly trivial these days.
|
|||||
|
|
|||||
|
|
|||||
|
Stupid programmer. It all depends on how you build the setup project, in terms of project properties, and if you do it correctly, a missing .NET framework will be installed automatically. However, since you are using the Express Edition of Visual Studio, your chances are somewhat limited as far setup projects if I am not mistaken. RĂ¼diger ------------------------- Well, it's past the point where we can make any changes in the code, but we can still make changes to the Easter Egg! |
|||||
|
|
|||||
|
|
|||||
|
Touche. That's good to know. Can you tell I'm mostly a Unix programmer? :-)
|
|||||
|
|
|||||
|
|
|||||
|
You are funny mdl. Crack me up! I haven't had a chance to give it a spin but it's on the todo list.
Max Roth www.freesr.org ------------------------- ErgoArchitect Assistive Technologies - ShowNumbers Plus! Addon to Naturally Speaking - www.ergoarchitect.com |
|||||
|
|
|||||
FuseTalk Standard Edition v4.0 - © 1999-2013 FuseTalk™ Inc. All rights reserved.