Author Topic: AutoHotkey "Integration" with VoiceAttack  (Read 162 times)

Exergist

  • Moderator
  • Sr. Member
  • *****
  • Posts: 325
  • Can you dig it?
AutoHotkey "Integration" with VoiceAttack
« on: July 19, 2018, 09:16:33 am »
What is it?
The attached VoiceAttack profile provides the means to use AutoHotkey functionality (version 1.1.29.01 as of this writing) within the VoiceAttack environment through C# inline functions. This project (VA-AHK.Integration) expands VoiceAttack's capabilities (i.e., directly leverage AutoHotkey functionality for use by VoiceAttack), provides more control over AutoHotkey processing, and enables easy communication between AutoHotkey and VoiceAttack. And you don't even need to have the AutoHotkey software installed.

So in summary this functionality may be useful for folks who use AutoHotkey scripts in conjunction with VoiceAttack and want:
  • Greater control over AutoHotkey script execution via VoiceAttack, which is handy especially for running VoiceAttack actions/commands in series with AutoHotkey scripts
  • A simple framework for passing variable data back and forth between AutoHotkey and VoiceAttack

Why would you do this?
During the early development of the (now obsolete) Physical keyboard & mouse input blocking profile I did a lot of research on how to use AutoHotkey to accomplish the task. In doing so I discovered amazing-andrew's AutoHotkey.Interop project on GitHub and I decided to take on the challenge of adapting his work for use with VoiceAttack.

I'm guessing that 2% (or less) of users will be interested in this...but that's okay ;)

So how do I use it?
If you're still with me down here then you can check out the attached VoiceAttack package as well as the associated VA-AHK.Integration GithHub repository. The README on GitHub provides a good overview of the project as well as details about how the functionality works at a high level. The profile included in the package contains example commands as well as the required supplementary files. I've provided thorough comments for every command action line in VoiceAttack and code line in the inline functions, so you should be able to follow along and learn how VA.AHK-Integration works and understand its capabilities. In short, the included commands demonstrate:
  • Execution of raw AutoHotkey code
  • Exeuction of an AutoHotkey script
  • A wide range of functionality packed into a single VoiceAttack command and inline function
  • A simple example showing the functionality spread across multiple VoiceAttack commands and inline functions
Please note that the VA-AHK.Integration package includes three libraries (.dll files) for use by the profile. Two of them are the 32 and 64-bit AutoHotkey libraries (both named AutoHotkey.dll and obtained from HotKeyIt's AutoHotkey_H Repository), and the third is the VA.AutoHotkey.Interop.dll (modified from amazing-andrew's AutoHotkey.Interop) for interfacing between C# and the AutoHotkey libraries. The commands automatically handle the moving of the VA.AutoHotkey.Interop.dll into VoiceAttack's Shared\Assemblies folder, and VA.AutoHotkey.Interop.dll will automatically locate and access the required AutoHotkey.dll. All appropriate links, credits, and source code may be found via the VA-AHK.Integration README on GitHub.

I've done a lot of testing in Windows 7 and 10 and everything appears to work as expected, though I don't have many AutoHotkey scripts available to further evaluate the functionality. If you have any questions or encounter any bugs or other unexpected behavior please let me know.

I have been developing this project on and off for quite a few months, so I'm glad to finally be able to release it. Enjoy! :)
« Last Edit: July 23, 2018, 07:41:48 am by Exergist »

Emiricol

  • Newbie
  • *
  • Posts: 1
Re: AutoHotkey "Integration" with VoiceAttack
« Reply #1 on: July 19, 2018, 01:21:00 pm »
This could be cool. What sorts of things are you using AutoHotkey for within VA?

Exergist

  • Moderator
  • Sr. Member
  • *****
  • Posts: 325
  • Can you dig it?
Re: AutoHotkey "Integration" with VoiceAttack
« Reply #2 on: July 19, 2018, 10:36:39 pm »
To be honest I don't personally use AHK with VA, and when I say that out loud it does sound nuts that I developed this project. But it was a good challenge to say the least.  :)

I know there are folks that are skilled at using AHK that like to use it in conjunction with the excellent UI and additional control that VA offers. Hopefully something like this project will be useful to some folks out there.
« Last Edit: July 20, 2018, 11:02:17 am by Exergist »