1.1.13 • Published 6 years ago

autohotkey.js v1.1.13

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

AutoHotKey.js

Make AutoHotKey Scripts In JavaScript

Greenkeeper badge Travis Codecov npm npm node contributions welcome

Documentation

Test Results

Coverage Report

Examples

Basic Script

require('autohotkey.js').init('Name Of File');

on('^t', function () {
  send('Hi');
});

Which Outputs

^t::
  Send, Hi
Return

Basic Script With If Statement

require('autohotkey.js').init('Name Of File');

on('^t', function () {
  If(winExist('"Untitled - Notepad"'), function () {
    send('Notepad Open');
  })
});

Which Outputs

^t::
  if (winExist("Untitled - Notepad")) {
    Send, Notepad Open
  }
Return

Basic Script With If/Else Statement

require('autohotkey.js').init('Name Of File');

on('^t', function () {
  If(winExist('"Untitled - Notepad"'), function () {
    send('Notepad Open');
  }).Else(function () {
    send('Notepad Not Open');
  });
});

Which Outputs

^t::
  if (winExist("Untitled - Notepad")) {
    Send, Notepad Open
  }
  else {
    Send, Notepad Not Open
  }
Return

Basic Script With Variables

require('autohotkey.js').init('Name Of File');

on('^t', function () {
  set('Variable', '"Untitled - Notepad"');
  If(winExist(get('Variable')), function () {
    send('Notepad Open');
  }).Else(function () {
    send('Notepad Not Open');
  });
  send(get('Variable').contents());
});

Which Outputs

^t::
  Variable := "Untitled - Notepad"
  if (WinExist(Variable)) {
    Send, Notepad Open
  }
  else {
    Send, Notepad Not Open
  }
  Send, %Variable%
Return

Runing Functions

get('Variable').get('Function').run('"Argrument"');
winExist(get('Variable').get('Function').runInline('"Argrument"'));

Store Output Script In Variable

const autohotkey = require('autohotkey.js');
var script = new autohotkey.Script();
autohotkey.init('Name Of File', script);

on('^t', function () {
  send('Hi');
});

Script Object

Script {
  text: '^t::\n  Send, Hi\nReturn\n',
  name: 'Name Of File.ahk',
  getText: function () {...},
  setText: function (text) {...},
  getName: function () {...},
  setName: function (name) {...}
}
1.1.13

6 years ago

1.1.12

6 years ago

1.1.11

6 years ago

1.1.10

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago