Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/ node-ahk Public

Desktop scripting with Node.js based on IronAHK βŒ¨πŸ–±πŸ”₯

Notifications You must be signed in to change notification settings

1j01/node-ahk

Repository files navigation

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.

About

Desktop scripting with Node.js based on IronAHK βŒ¨πŸ–±πŸ”₯

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /