autohotkey script as a toggle for DNS? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jim7181812
Posts: 16
Joined: 10 Jun 2016, 10:46

autohotkey script as a toggle for DNS?

06 Aug 2017, 12:56

I'm trying to toggle Dragon Naturally Speaking's Recognition mode back and forth between spell mode and Dictation & Commands mode with a single keypress. Is there anyway I can do this with AHK? I cant find a keyboard shortcut for it.
Elgin
Posts: 124
Joined: 30 Sep 2013, 09:19

Re: autohotkey script as a toggle for DNS?  Topic is solved

06 Aug 2017, 13:30

Hi there!

You need COM to do that:

Code: Select all

SpeechEngine:= ComObjCreate("Dragon.DgnEngineControl")
try
{
	SpeechEngine.Register(0)
}
catch, e
{
	MsgBox, Can't connect to Dragon
	ExitApp
}
dgnrecmodeNormal := 0x0  ; Commands and Dictation mode
dgnrecmodeDictation := 0x1  ; Dictation mode
dgnrecmodeCommand := 0x2  ; Commands mode
dgnrecmodeNumbers := 0x3  ; Numbers mode
dgnrecmodeLetters := 0x4  ; Spell mode
dgnrecmodeMouseMotion := 0x5  ; Mouse Motion mode
OnExit, ExitSub
return


!F11::
	SpeechEngine.RecognitionMode:=dgnrecmodeLetters
return

!F12::
	SpeechEngine.RecognitionMode:=dgnrecmodeNormal
return

ExitSub:
SpeechEngine.UnRegister(False)
SpeechEngine:=
ExitApp
jim7181812
Posts: 16
Joined: 10 Jun 2016, 10:46

Re: autohotkey script as a toggle for DNS?

06 Aug 2017, 13:50

AHA!!!

It didnt work when I tried to paste your code snippet into my script, but as a standalone script it worked perfectly. You sir (or ma'am) are the effing man (or woman)!!!!
Elgin
Posts: 124
Joined: 30 Sep 2013, 09:19

Re: autohotkey script as a toggle for DNS?

06 Aug 2017, 14:31

When you merge my code with your script the lines up to the first return also need to go in the beginning of your script.
See Auto-execute section here:
https://autohotkey.com/docs/Scripts.htm#auto
You sir (or ma'am) are the effing man (or woman)!!!!
Thank you!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 357 guests