I am announcing JsRoboKey as one of my entries to NANY 2014. Right now it is pre-alpha but it's got some starter features similar to AutoHotkey.
I hope to get version 1.0 in by the new year!
In case you want some teasers, the app sits in the tray (similar to ahk) and will run a script. Here are some examples (go to
http://github.com/relipse/JsRoboKey for more readable format):
Example Scripts
---------------
###### sendKeys()
A simple script might look like this:
//run notepad, wait a little bit for it to open, then send some keystrokes
rk.run('notepad');
rk.sleep(700);
rk.sendKeys('abcdefgABCDEFG1234567890!@#$%^&*()');
###### addGlobalHotkey()
Or even better, trigger to run notepad after a certain hotkey!
rk.addGlobalHotkey('Meta+Alt+N', function(){
rk.run('notepad');
});
(Meta) means the Windows key
###### getForegroundWindow() and getWindowText()
And demonstrating some new functionality, this script will run notepad and wait for it to open
function fgWinMatches(winTitle){
var hwnd = rk.getForegroundWindow();
var title = rk.getWindowText(hwnd);
if (title.toLowerCase().indexOf(winTitle.toLowerCase()) >= 0){
return {hwnd:hwnd,title:title};
}else{
return false;
}
}
function winWait(winTitle, callback){
var match = fgWinMatches(winTitle);
if (match === false){
rk.setTimeout(function(){
winWait(winTitle, callback);
},400);
}else{
callback(match);
}
}
rk.run('notepad');
winWait('notepad', function(match){
rk.sendKeys('Hello World');
});
###### onClipboardChange()
A new feature onClipboardChange() which sets up a callback when the clipboard changes, think of the possibilities!
rk.onClipboardChange(function(data){
if (typeof(data) != 'string'){ return; }
if (data.indexOf('foobar') >= 0){
rk.alert('foobar on clipboard: ' + data);
}
});
###### onKeyPress() onKeyRelease()
*unstable* not yet in master (hotfix_keylisten branch)
rk.allowKeyListen();
rk.onKeyRelease(function(key){
if (key == 'F7'){
rk.sendKeys('Hello World F7');
}
});
###### trayMsg()
demonstrating a few of the latest features as well,
after the tray bubble message gets shown, the callback gets called when the user clicks the tray message
rk.trayMsg('Hi','Check if JsRoboKey executable file exists...', function(){
alert(__APPFILEPATH__ + ' exists: ' +
rk.fileExists(__APPFILEPATH__));
});
rk.trayMsg('About','Click to open the JsRoboKey website', function(){
rk.openUrl('http://github.com/relipse/JsRoboKey');
});