index.js
Code: Select all
const spawn = require('child_process').spawn
ahk = spawn("C:/Program Files/AutoHotkey/v2/AutoHotkey64.exe", ['ahk/stdin.ahk']);
dataString = '';
ahk.stdout.on('data', function (data) {
dataString += data.toString();
let toSend = '';
for (let i = 0; i < data.length; i++) {
toSend += String.fromCharCode(data[i]);
}
console.log(toSend);
});
ahk.stdout.on('end', function () {
console.log('end');
});
ahk.stdin.write('some example' + '\r\n');
Code: Select all
DllCall("AllocConsole")
stdin := FileOpen("*", "r `n")
stdout := FileOpen("*", "w `n")
init()
Return
~esc::{
ExitApp
}
init(){
While(True){
stdout.Write("Enter your query.`n\> ")
stdout.Read(0)
query := RTrim(stdin.ReadLine(), "`n")
stdout.WriteLine("Your query was '" query "'. Have a nice day.")
stdout.Read(0)
}
}