Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use AutoIt DLL on windows instead of current way. #218

Closed
iShafayet opened this issue Jun 21, 2016 · 8 comments
Closed

Use AutoIt DLL on windows instead of current way. #218

iShafayet opened this issue Jun 21, 2016 · 8 comments

Comments

@iShafayet
Copy link

AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages.

https://www.autoitscript.com/site/

It is somewhat similar to AutoHotKey and they have a history. One is derived from the other. Regardless, AutoIt provides AutoItX. basically a windows DLL that can be used in other applications to provide most of the features provided by AutoIt. It contains cursor control, keyboard, global hooks, image/pixel features etc.

I believe it's worth considering as an alternative to the current process on windows which requires visual studio and python to be installed.

@octalmage
Copy link
Owner

Hi there,

I'm familiar with AutoIt and the DLL, AutoHotkey also provides one. Visual studio and Python are no longer required to install RobotJS, and most of the Windows features are already implemented. Thanks for the suggestion!

@iShafayet
Copy link
Author

I see. I confused build dependency on Visual Studio and Python with runtime dependency. Really sorry for wasting your time.

It's a great project that you've got going on here.

@octalmage
Copy link
Owner

No worries man! It's a great idea, honestly not one I considered. It might be cool to make a wrapper as a side project, with a similar API to AutoIT.

@iShafayet
Copy link
Author

That'd be great. I used to hang around AutoIt forums a lot in it's early days. It'd be nice to see it's legacy continue in nodejs.

@1j01
Copy link

1j01 commented Jun 23, 2016

I started a project a while back called node-ahk with similar goals. I'd still like to continue it at some point, probably with a focus on window manipulation since RobotJS already does mouse and keyboard stuff.

@johnmarlow007
Copy link

Hello. First of all, this is an amazing project. Thanks for offering it as open source for us.
I would like to use it and contribute as much as I can.

There is something I am trying though and I can't find a solution for. It's on windows...
I need to open different applications/windows and then press keys or click on them.
(Something like WshShell.SendKeys and object.AppActivate from VBS, which I use sometimes)

So far I tried with robotjs to doubleclick an icon which launched a window fine, then sent some keys, but that window is not active (focused), so the keys were sent to the desktop, so no use...

Also, I tried to use node's "child_process" to open a window, which works too, but I don't how (or if it's even possible) to integrate robotjs in that stream to make it interact with the opened window/app.

Here is the code I use.

var robot;
var theJobType = 'FOO';
var exec = require('child_process').exec;
var child = exec('%windir%\system32\notepad.exe ' + theJobType,
{
stdio: [
robot = require("robotjs"),
robot.typeString('Hello from robot'),
console.log('Hello in console')
]
}, function( error, stdout, stderr)
{
if ( error != null ) {
console.log(stderr);
// error handling & exit
}
// normal

});

What I noticed is that it opens the notepad window fine, then it writes "Hello in console", even though it's after the robotjs call, then only when I close the notepad window, it writes 'Hello from robot' also in the console, instead of the currently active window, as it should.

Maybe your brilliant minds will elucidate this issue.
Thank you so much for your time.
Andy.

@octalmage
Copy link
Owner

@1j01 that's awesome, it would be great if a library for window manipulation existed!

@artitmedia does it work if you click on the window after it's opened?

@octalmage
Copy link
Owner

I'm going to close this, @artitmedia if you still need help please open a new issue.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants