Skip to content
Advertisement

What is the Node.js equivalent of pywinauto in Python?

I have many scripts written in python which use the pywinauto library. These scripts are opening programs on Windows, doing things within them, etc. Now that I’ve begun to learn Node.js, I have only found so far Robot.js, which is certainly promising but lacks the ability I think to get into the nitty-gritty details like pywinauto does.

For example, suppose I wanted to locate a program called “Wordperfect” if it was open or not and if open, kill the program and reopen it. Here’s how I am doing that in python using pywinauto:

JavaScript

This is just the beginning of my script. It becomes much more complex from here. Unfortunately, so far I have not found a specific way to do this within Node.js. Can anyone let me know if there is and how to do it? I’ve been checking out child-process in the Node.js documentation but from what I saw in the examples, it’s not clear how to recreate what I have in python above.

Advertisement

Answer

Ultimately I found Robot.js which does the same thing on windows except create a bundle of EXE.

https://www.npmjs.com/package/robotjs

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement