Make AutoHotKey Scripts In JavaScript
npm install autohotkey.js      
js
require('autohotkey.js').init('Name Of File');on('^t', function () {
send('Hi');
});
`#### Which Outputs
`ahk
^t::
Send, Hi
Return
`$3
`js
require('autohotkey.js').init('Name Of File');on('^t', function () {
If(winExist('"Untitled - Notepad"'), function () {
send('Notepad Open');
})
});
`#### Which Outputs
`ahk
^t::
if (winExist("Untitled - Notepad")) {
Send, Notepad Open
}
Return
`$3
`js
require('autohotkey.js').init('Name Of File');on('^t', function () {
If(winExist('"Untitled - Notepad"'), function () {
send('Notepad Open');
}).Else(function () {
send('Notepad Not Open');
});
});
`#### Which Outputs
`ahk
^t::
if (winExist("Untitled - Notepad")) {
Send, Notepad Open
}
else {
Send, Notepad Not Open
}
Return
`$3
`js
require('autohotkey.js').init('Name Of File');on('^t', function () {
set('Variable', '"Untitled - Notepad"');
If(winExist(get('Variable')), function () {
send('Notepad Open');
}).Else(function () {
send('Notepad Not Open');
});
send(get('Variable').contents());
});
`#### Which Outputs
`ahk
^t::
Variable := "Untitled - Notepad"
if (WinExist(Variable)) {
Send, Notepad Open
}
else {
Send, Notepad Not Open
}
Send, %Variable%
Return
`#### Runing Functions
`js
get('Variable').get('Function').run('"Argrument"');
winExist(get('Variable').get('Function').runInline('"Argrument"'));
`$3
`js
const autohotkey = require('autohotkey.js');
var script = new autohotkey.Script();
autohotkey.init('Name Of File', script);on('^t', function () {
send('Hi');
});
`#### Script Object
`js
Script {
text: '^t::\n Send, Hi\nReturn\n',
name: 'Name Of File.ahk',
getText: function () {...},
setText: function (text) {...},
getName: function () {...},
setName: function (name) {...}
}
``