As presented I don't really like the idea, but I have many times wished that I had AHK's functions exported to a DLL where I could call them from another scripting language.
I routinely work in about five or six scripting languages for various tasks, and I frequently end up using features from other scripting languages. It would be
very cool if I could call some subset of the root AHK functions from another scripting language.
I currently implement a sort of hack in most languages where I define a snippet of AHK code as a string, write it to a temp file and execute that temp file. For example, in the Visual SlickEdit Script Language I use for industrial strength text processing, I have a function:
Code:
_command void AhkRun(...) name_info(',') {
_str Code[];
int ArgIx;
for (ArgIx = 1; ArgIx <= arg(); ArgIx++)
ArrayAppend(Code, arg(ArgIx));
FileWriteLines('C:\Temp\Work.ahk'
, '#SingleInstance force'
, '#include C:\AutoHotkey\AHKLib.ahk'
, ''
, Code
, ' ExitApp'
, '');
execute('AutoHotkey.exe', 'C:\Temp\Work.ahk');
}
That basically takes a parameter array of AHK statements, generates a temp file and executes it. It would be so much nicer if I could just call the functions directly. I have similar functions for Python, 4NT and PowerShell. If I had an AutoHotkey.dll with a collection of exported functions, I'd use it all the time from other tools.
I've considered taking the source code and making it myself, but never quite got around to it.
I also think it would be excellent if I could leverage the HOTKEY and HOTSTRING functionality in another language. For example, I can define a lot of hotkeys in WinWord, but not in Excel. If I could call HOTKEY from VBA, I'd use it to customize Excel. I currently do something like that by having a whole bunch of #IfWinActive statements in an AHK script I have running 100% of the time, but it's hard to get good granularity that way. I've considered making a sort of AHK Server to do the job using messaging which would be relatively easy, but it's a bit of a hack.
I like AHK and use it all day every day, but it would be nice if I could use pieces of it from other languages without jumping through hoops.