Live data from Hacker News

RobotJS – Node.js Desktop Automation

github.com

51–60 of 64 posts

Re: RobotJS – Node.js Desktop Automation

#51
post #21

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...

Out of curiosity, have you looked at Sikuli [1]? [1]: http://www.sikuli.org/

Check out Morgan Dixon's awesome research project Prefab: The Pixel-Based Reverse Engineering Toolkit, which would be great to integrate into RobotJS.

http://homes.cs.washington.edu/~mdixon/research/prefab/

Re: RobotJS – Node.js Desktop Automation

#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...

Re: RobotJS – Node.js Desktop Automation

#53

Earlier quoted context omitted.

I've used Selenium a bunch the last couple months to automate daily/hourly jobs to pull data from 3rd party UIs that don't offer an API. I couldn't imagine not having a tool like Selenium at my disposal!

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?

Re: RobotJS – Node.js Desktop Automation

#54
post #43
post #39

Earlier quoted context omitted.

I'm sure it's possible, but one way to avoid it -- turn the constant into a method: > robot.keys.ENTER() (Not great for key combos, though...)

I'd then go with robot.keys.enter() (since enter is a function, not a constant) and make it chainable by returning `robot.keys`. robot.keys.ctrl().enter()

You'd probably want something slightly different than keys - at least some way to different between key presses and hold the keys down at the same time.

Re: RobotJS – Node.js Desktop Automation

#55
post #21

Earlier quoted context omitted.

Out of curiosity, have you looked at Sikuli [1]? [1]: http://www.sikuli.org/

I hadn't heard of it before, and it does look potentially very powerful. My only initial concern from reading the quick start ( http://www.sikulix.com/quickstart.html ) is the apparent requirements to use the "SikuliX IDE" for scripting...

You actually don't need to use their IDE as the scripts it generates are just python scripts.

I've used it a few times in the past and was able to use an external screenshot program (Apple-Shift-4 on Mac) and a text editor to write the scripts.

Re: RobotJS – Node.js Desktop Automation

#56

RobotJS + chrome drivers (and therefore CSS selectors for mouse/keyboard actions) would be the holy grail for integrations testing. webdriver.io kind of does that now, but it's a bit finicky... Any idea how I'd set that up?

I think it would be awesome if we can somehow hook this into some API that grabs

- the process list - list of the window positions - text under a cursor - provides an interface to create specialized keyboard/mouse actions for specific apps (because why stop at chrome?)

i'm sure this is project is going to be quite popular :)

Re: RobotJS – Node.js Desktop Automation

#57
post #30

Earlier quoted context omitted.

Awesome! AutoIt is great. AutoHotkey wouldn't exist if it wasn't for AutoIt. AutoHotkey has also improved a bunch recently. Lexikos picked up development and he's done a killer job. But unfortunately it (and AutoIt) will never be cross platform. That's why I made RobotJS. I honestly never thought about a community but that's an amazing idea. A classic forum would be great, I've spent so much time on the AutoHotkey/Au…

Why won't it ever be cross-platform? Would the effort just be too gargantuan?

There's been many attempts over the past 5 years and IronAHK got the closest, but yeah both languages rely 100% on Windows specific APIs. I hope later on to write an AHK to JavaScript compiler/interpreter. This would make the language more portable.

Re: RobotJS – Node.js Desktop Automation

#58
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)

Yeah AutoHotkey is amazing. I've written many successful apps in AHK. Like this one:

https://github.com/octalmage/mDesktop

With RobotJS and nw.js I've been able to port many of my apps to JavaScript, and ultimately make them cross platform.

Re: RobotJS – Node.js Desktop Automation

#59
post #21

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...

Out of curiosity, have you looked at Sikuli [1]? [1]: http://www.sikuli.org/

Sikuli is awesome, I've used it a bunch. But developing and distributing cross platform commercial applications with it is a mess. Also interacting with other languages, to make a GUI for example, isn't fun.

Re: RobotJS – Node.js Desktop Automation

#60
post #20

Earlier quoted context omitted.

I stand corrected. I looked closer. I never knew node modules could be written in C.

I was searching around for a js wrapper, but found that even the JS API was implemented in C [1]. I would only implement the low level "hardware" primitives in C, then implement the high level API in JS like Chromium's Blink-in-JS initiative [2]. Once they start expanding the high level functionality, they will lose potential contributors by sticking with pure C. [1] https://github.com/octalmage/robotjs/blob/master/s…

You'd be surprised by how many C/C++ programmers there are out there! I've already been surprised by the number of contributions. But yeah, using C wasn't a choice, it was the only option. Luckily we already have all planned features implemented in C.
Post reply on HN