Author Topic: AutoHotKey Integration  (Read 4037 times)

FlyingFree

  • Guest
AutoHotKey Integration
« on: January 12, 2017, 02:46:27 AM »
Enabling integration with AutoHotKey would greatly enhance the versatility of VoiceAttack. Even something as simple as being able to share variables with it would allow for a large degree of interaction between the two.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: AutoHotKey Integration
« Reply #1 on: January 12, 2017, 09:21:10 AM »
On a side note, there's a plugin interface plus the new, 'inline function' feature (latest betas) that could help with that if anybody would like to tackle that project for fun and/or profit ;)

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: AutoHotKey Integration
« Reply #2 on: January 12, 2017, 10:59:02 AM »
You might want to take a look here:
https://github.com/amazing-andrew/AutoHotkey.Interop
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: AutoHotKey Integration
« Reply #3 on: June 13, 2017, 03:34:03 PM »
I was able to get one of the AutoHotkey.Interop examples to compile and execute in MS Visual Studio (Visual C# Console App project) using assemblies: Microsoft.CSharp.dll;System.dll;System.Core.dll;System.Data.dll;System.Data.DataSetExtensions.dll;System.Net.Http.dll;System.Xml.dll;System.Xml.Linq.dll;AutoHotkey.Interop.dll ...and the following code:

Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class VAInline
{
    static void Main()
    {
        //grab a copy of the AutoHotkey singleton instance
        var ahk = new AutoHotkey.Interop.AutoHotkeyEngine();
        //execute any raw ahk code
        ahk.ExecRaw("MsgBox, Hello World!");
    }
}

Applying this same code and referenced assembly set to an inline C# function in VA unfortunately does not work. Note that the auther of the Interop.dll uses "var ahk = new AutoHotkey.Interop.AutoHotkeyEngine();" instead of "var ahk = AutoHotkeyEngine.Instance;" in his sample code. Yes I changed the "Main" to "main" and I added the AutoHotkey.Interop.dll to my v4 Framework folder, and the code DOES compile. But when I run the code I get the following error:

Quote
Exception has been thrown by the target of an invocation. Could not load file or assembly 'AutoHotkey.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Anyone have any suggestions?


EDIT: attached AutoHotkey.Interop.dll used for testing
« Last Edit: June 14, 2017, 08:29:12 AM by Exergist »