viewpoint-particle

Author Topic: modifying a simple vbs script for use in WinBatch  (Read 204 times)

Ron47

  • Newbie
  • *
  • Posts: 19
modifying a simple vbs script for use in WinBatch
« on: May 10, 2019, 04:51:02 pm »
I use the Dragon speech program and have a vbs script that will run Dragon commands as if I spoke them.

The following vbs script turns off the Dragon microphone. How can I modify the script so I can use it in Winbatch?

x="close microphone"
Set Dgn = GetObject("","Dragon.DgnEngineControl")
Dgn.Register
Dgn.RecognitionMimic(x)
Dgn.UnRegister(0)
Set Dgn = Nothing

Thanks!

Ron


stanl

  • Pundit
  • *****
  • Posts: 936
Re: modifying a simple vbs script for use in WinBatch
« Reply #1 on: May 12, 2019, 02:24:23 am »
try
Code: Winbatch
x="close microphone"
Dgn = GetObject("","Dragon.DgnEngineControl")
Dgn.Register()
Dgn.RecognitionMimic(x)
Dgn.UnRegister(0)
Dgn = 0
Exit
 

Ron47

  • Newbie
  • *
  • Posts: 19
Re: modifying a simple vbs script for use in WinBatch
« Reply #2 on: May 12, 2019, 09:15:06 am »
That works!
Much appreciated!

Ron

td

  • Tech Support
  • *****
  • Posts: 3017
    • WinBatch
Re: modifying a simple vbs script for use in WinBatch
« Reply #3 on: May 13, 2019, 01:12:43 pm »
And, hopefully, time was taken to understand what Stan changed to make the VBS example a WinBatch script instead of just performing a copy&paste.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade