Live data from Hacker News

RobotJS – Node.js Desktop Automation

github.com

61–64 of 64 posts

Re: RobotJS – Node.js Desktop Automation

#61
post #45

Despite its many syntax quirks, AutoHotkey is an amazingly powerful tool for automating Windows keyboard and mouse input - I use it daily at work. Having an equivalent tool on the Mac would be awesome, as I don't think anything in AutoHotkey's class exists right now...

Autohotkey is a crazy dense macroing tool; I originally thought it was just move the mouse and type, but it can do so, so much more- interface with spreadsheets, web browsers, heck, there's even a tiling window manager out there that's programmed in ahk script. (bug.n)

As another example, I wrote some scripts (well, hacked together other people's work) to map MIDI CC values to a virtual joystick's Y axis, so I could use my MIDI expression pedal as an accelerator pedal in Euro Truck Simulator 2.

Re: RobotJS – Node.js Desktop Automation

#62

is there anything like this for browsers? I know theres things like casperjs but that seems more "browser test" specific, not "browser automation"

Selenium can be used for browser automation.

I ran into a problem with the automation project I was working on when I tried using Selenium. I was trying to print (shipping labels from Amazon) and Selenium (at least Chrome webdriver) can't see the print dialog :( Any ideas?

Re: RobotJS – Node.js Desktop Automation

#63

Earlier quoted context omitted.

Pro tip: create a chrome extension with permissions on all http:// and https:// sites, or run it through Node-Webkit/nw.io, then you can use the generic DOMParser and querySelectorAll with a pretty fluent interface on any site you can imagine. example here: https://github.com/SchizoDuckie/DuckieTV/blob/angular/js/uti...

> or run it through Node-Webkit/nw.io That's quite interesting! I thought node-webkit isn't suitable (yet) for such purpose. Could you go into more detail on how to do parsing/automation external sites with it?

It's very suitable! (I'm using it in DuckieTV in production, works like a charm!)

Basically, you can use xmlhttp to fetch any webpage becaused of relaxed restrictions. then use DOMParser (a built-in browser component, that you can even shim) to create a virtual DOM of that xmlhttp result, and execute regular querySelector and querySelectorAlll queries on that :)

Re: RobotJS – Node.js Desktop Automation

#64
post #52
post #27

Cool project! Seems like its capabilities are somewhat similar to Hammerspoon, an OS X project where you can script almost anything in the OS with Lua. I believe it was forked from Mjolnir. I use it for window management (which is it awesome at, especially considering I have a very complex arrangement with a 4K monitor + laptop screen), automatic mute when not home, remapping shortcuts, and more. The config syntax is…

Came to post the same thing. Here's mine: https://github.com/heptal/dotfiles/blob/master/roles/hammers...

That's a nice one, especially the paste block workaround. That is my #1 least favorite security fad/flaw.
Post reply on HN