AutoHotkey equivalent

keyboardscripting

Is there an equivalent product/method for AutoHotkey?

For those that don't know, it's a product that allows you to program your mouse movements and keyboard. This allows me to "macro" certain functions on programs instead of having to do it manually. In the old days they used to call them keyboard stuffers. But that is only half of the solution as I need a "mouse movement" stuffer as well.

Is there such a beast?

Best Answer

There's a port of AutoHotKey to Linux called IronAHK and a similar tool called Autokey. I haven't used either, I don't know how well they work.

Other than such programs, you won't find exactly the same kind of automation tools. The basic user automation tool on unix systems is the shell. The shell is the glue that combines other tools: it can launch external programs and control how they exchange data. The shell itself doesn't include anything to manipulate GUI concepts like windows and the mouse pointer¹. What you do is call specialized tools in a shell script, in particular xdotool to manipulate windows, and inject keystrokes and mouse events.

For example, the following script clicks at the position (40,20) in the window of Myapp.

#!/bin/sh
xdotool search --class Myapp \
        mousemove --window %1 40 20 \
        click 1

¹ Except for dtksh, but I've never seen a Linux port of it.

Related Question