Desktop scripting with Node.js based on IronAHK ⌨🖱🔥
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
IronAHK IronAHK Jan 27, 2015
.gitattributes Initial Commit Jan 27, 2015
.gitignore Initial Commit Jan 27, 2015
NodeAHK.cs
README.md Update README.md Jun 23, 2016
main.coffee Update module Mar 16, 2015
package.json Update package.json Jun 13, 2018
test.coffee Update module Mar 16, 2015

README.md

node-ahk

This project aims to use IronAHK in Node.js via Edge.js with the benefit of all the existing modules on npm.

There's a project that's further ahead in development called RobotJS.

It could have a playful API with clever usage of concatenation and optional globals.

The following example is in CoffeeScript, but you could use JavaScript, TypeScript, DogeScript, Python, Ruby, etc.

on Ctrl+Alt+C, ->
    oldClipboard = getClipboard()
    send Ctrl+C
    newClipboard = getClipboard()
    setClipboard oldClipboard
    send Ctrl+V
    setClipBoard newClipboard

All the keyboard constants would be strings with control characters at the start and end, to differenciate between e.g. Ctrl+Esc and `"Ctrl+Esc"``. That would mean you wouldn't accidently send commands when you wanted to send text (but sending arbitrary user input would still be dangerous).

There could also be "AutoHotQuery" (ahq) with a jQuery-like API for selecting and operating on windows.

$(/Google Chrome|Mozilla Firefox|Microsoft Edge/).focus()
.then -> Send Ctrl+T, "google.com", Enter

Look, no SetTitleMatchMode! Amazing.

That would open a new tab in one browser window. To open new tabs in each matched window, you could do:

$(/Google Chrome|Mozilla Firefox|Microsoft Edge/).send(Ctrl+T, "google.com", Enter)

With Edge.js, everything can be syncronous or asyncronous.

The creator of IronAHK did try to make it modular (and it could be much worse) but they still let paradigms like ErrorLevel and other global state seep into the core. IronAHK would need to be refactored or more likely cannibalized in order to implement much of the functionality. I only got a few functions more or less working without modifying IronAHK.

At any rate, this project is not being actively worked on, so definitely check out RobotJS.