AutoHotkey is a free, open-source custom scripting language for Microsoft Windows, initially aimed at providing easy keyboard shortcuts or hotkeys, fast macro-creation and software automation that allows users of most levels of computer skill to automate repetitive tasks in any Windows application. User interfaces can easily be extended or modified by AutoHotkey (for example, overriding the default Windows control key commands with their Emacs equivalents). The Autohotkey installation includes its own extensive help file with an always updated web based version.
You can write mouse or keyboard macros, remap keys, create hotkeys, expand abbreviations, change clipboard contents, and make executables to run hotkey scripts on computers without AutoHotkey installed.
Gui, +AlwaysOnTop +Disabled -SysMenu +Owner ; +Owner avoids a taskbar button. Gui, Add, Text,, Some text to display. Gui, Show, NoActivate, Title of Window ; NoActivate avoids deactivating the currently active window.
Show a "Hello World!" in message box.
MsgBox, Hello World!
Show a "Hello World!" in tooltip.
#Persistent Tooltip, Hello World!
Show a "Hello World!" message in the traybar edit.
#Persistent TrayTip,, Hello World!
Prints "Hello, World" to Standard Output (stdout).
FileAppend, % "Hello, World", *
Once you have AutoHotkey installed, you will probably want it to do stuff. AutoHotkey is not magic, we all wish it was, but it is not. So we will need to tell it what to do. This process is called "Scripting".
So now that you have created a script, we need to add stuff into the file. For a list of all built-in commands, function and variables, see section 5. Here is a very basic script containing a Hotkey which types text using the Send command when the hotkey is pressed.
^j:: Send, My First Script Return
We will get more in-depth later on. Until then, here's an explanation of the above code.
^j::is the Hotkey.
jis the letter j. Anything to the left of
::are the keys you need to press.
Send, My First Scriptis how you
SENDis the command, anything after the comma (,) will be typed.
Return. Return will become your best friend. It literally STOPS code from going any further, to the lines below. This will prevent many issues when you start having a lot of stuff in your scripts.
Use as portable software
If you have chocolatey installed, run the following command as an admin user
choco install autohotkey
Alternatively, it can be built from the source code. See here for details:
Gui, Add, Text,, Hello World! Gui, Show, w200 h200 return GuiClose: ExitApp