Make AutoHotKey Scripts In JavaScript
require('autohotkey.js').init('Name Of File');
on('^t', function () {
send('Hi');
});
^t::
Send, Hi
Return
require('autohotkey.js').init('Name Of File');
on('^t', function () {
If(winExist('"Untitled - Notepad"'), function () {
send('Notepad Open');
})
});
^t::
if (winExist("Untitled - Notepad")) {
Send, Notepad Open
}
Return
require('autohotkey.js').init('Name Of File');
on('^t', function () {
If(winExist('"Untitled - Notepad"'), function () {
send('Notepad Open');
}).Else(function () {
send('Notepad Not Open');
});
});
^t::
if (winExist("Untitled - Notepad")) {
Send, Notepad Open
}
else {
Send, Notepad Not Open
}
Return
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());
});
^t::
Variable := "Untitled - Notepad"
if (WinExist(Variable)) {
Send, Notepad Open
}
else {
Send, Notepad Not Open
}
Send, %Variable%
Return
get('Variable').get('Function').run('"Argrument"');
winExist(get('Variable').get('Function').runInline('"Argrument"'));
const autohotkey = require('autohotkey.js');
var script = new autohotkey.Script();
autohotkey.init('Name Of File', script);
on('^t', function () {
send('Hi');
});
Script {
text: '^t::\n Send, Hi\nReturn\n',
name: 'Name Of File.ahk',
getText: function () {...},
setText: function (text) {...},
getName: function () {...},
setName: function (name) {...}
}