The title says it all. Is there a way to write macros in JavaScript to achieve a similar functionality to that of Autoit? I just would want to manipulate files on my own puter (offline) and could easily do it with autoit, but since I am currently learning JavaScript -- plan to develop in Node.js -- I figure it wouldn't hurt to get the extra practice.
Thanks guys!
The title says it all. Is there a way to write macros in JavaScript to achieve a similar functionality to that of Autoit? I just would want to manipulate files on my own puter (offline) and could easily do it with autoit, but since I am currently learning JavaScript -- plan to develop in Node.js -- I figure it wouldn't hurt to get the extra practice.
Thanks guys!
Share Improve this question edited Jan 11, 2014 at 19:33 Paul Sweatte 24.6k7 gold badges131 silver badges268 bronze badges asked Dec 19, 2013 at 15:40 PytthPytth 4,1861 gold badge27 silver badges32 bronze badges 1- Wele to SO please read this: stackoverflow./tour – Roko C. Buljan Commented Feb 18, 2014 at 22:17
5 Answers
Reset to default 3Use an application which supports JavaScript as a shell scripting language, such as the following:
- JsRoboKey
- PowershellJS
- PowerChakra
- RemoteNodeJS
- JScript + WSH
- JavaScript Shell Scripting with JSC
- QtScript: QScriptEngine
- Part I: How to Choose a JavaScript Engine for iOS and Android Development - OpenAphid-Engine
nodejs has a module which do autoit things --
nodejs install autoit
var au = require('autoit');
au.Init();
au.Run("notepad.exe");
au.WinWait("[Class:Notepad]");
au.Send("Hello, autoit & nodejs!");
NodeJS is a very powerfull platform, it is extensible and opensource. There is no problem to run local scripts to do everything you need using JavaScript (see standard FileSystem library docs). You can also try to look in NPM(NodeJS package manager).
Assuming you have AutoIt installed (say in folder C:\AU3) and this folder in the PATH, you can add extension '.AU3' to the PATHEXT environment variable, and create an AutoIt script called, say, hello.au3 with just a silly line:
MsgBox(0, "Warning", "Hello, World!")
Now, simply typing the mand 'hello' will execute the script, displaying the silly message in a modal message box.
Next, create an equally silly Node.js script, say, MyWarn.js - in the same folder:
var oCP = require("child_process");
console.log("Starting...");
var oNP = oCP.execSync("hello");
console.log("Done.");
Assuming Node is also in the PATH, try this mand:
node MyWarn
So ... we get the benefits of Node (for its jit), and the benefits of AutoIt (for its GUI handling.) The problem is getting the two to municate. Personally, I use a RamDisk to pass small files...
Javascript can't write to a file on your local machine remotely.. Its almost the same as HTML in a view model.
It can however perform some executions of other scripts via AJAX for example. But thats on server again. It might be worth a look to read on server && client side differences.
im not 100% sure but node might offer another outlet on this but it would still be server side.. Not locally.
The Server - This party is responsible for serving pages and handling the logic | Code behind.
The Client - This party requests pages from the Server, and displays them to the user. On most cases, the client is a web browser.
The User - The user uses the Client in order to surf the web, fill in forms, watch videos online, etc.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744938969a4602203.html
评论列表(0条)