kids encyclopedia robot

AutoHotkey facts for kids

Kids Encyclopedia Facts
Quick facts for kids
AutoHotkey
AutoHotkey logo.png
Developer(s) Chris Mallett, Steve Gray
Initial release November 10, 2003; 20 years ago (2003-11-10) (Chris Mallet)
July 18, 2008; 15 years ago (2008-07-18) (Steve Gray)
Stable release
1.1.31.01 / October 14, 2019; 4 years ago (2019-10-14)
Preview release
2.0-a105 / September 22, 2019; 4 years ago (2019-09-22)
Operating system Microsoft Windows
Type Scripting language Automation GUI utility
License GPL

AutoHotkey is a free, open-source scripting language for Microsoft Windows. It allows users to create keyboard shortcuts or hotkeys, fast macro-creation and software automation. It allows users to automate repetitive tasks in any Windows application. User interfaces can be extended or modified by AutoHotkey. For example, replacing the Windows control key commands with their Emacs equivalents. The AutoHotkey installation includes a help file. Documentation is available on the internet.

Features

AutoHotkey scripts can be used to load programs, open documents, and issue keystrokes and mouse clicks.

AutoHotkey scripts can also change variables and manipulate windows, files, and folders.

AutoHotkey scripts can be started by a hotkey. When the user presses a combination of keys, such as Ctrl on the keyboard, a script could open a web browser.

Keyboard keys can be remapped, such that pressing Ctrl might result in the active window receiving an en dash (–). The same keys could be disabled, such that pressing Ctrl might result in nothing happening at all.

AutoHotkey also allows for 'hotstrings' that will automatically replace certain text as it is typed. A typical use for hotstrings is expanding abbreviations. Typing "btw" could be made to produce the text "by the way".

Scripts can be started automatically when the computer starts. These could run in the background and could be used to write information to a logfile.

More complex tasks can be making custom data entry forms (GUI windows), working with the system registry, or using the Windows API by calling functions from DLLs. The scripts can be compiled into an executable file that can be run on other computers that do not have AutoHotkey installed.

The source code is in C++ and can be compiled with Visual Studio Express.

Memory access through pointers is allowed just as in C.

Some uses for AutoHotkey:

  • Remapping the keyboard, such as from QWERTY to Dvorak or other alternative keyboard layouts.
  • Using shortcuts to fill in frequently-used file names or other phrases.
  • Typing punctuation not provided on the keyboard, such as curved quotes ().
  • Controlling the mouse cursor with a keyboard or joystick.
  • Opening programs, documents, and websites with simple keystrokes.
  • Adding a signature to e-mail or message boards.
  • Monitoring a system and automatically closing unwanted programs.
  • Scheduling an automatic reminder, system scan, or backup.
  • Automating repetitive tasks.
  • Filling out contest and freebie forms automatically (it could type in your name, address, and so on, automatically).
  • Prototyping before implementing in another, more time consuming, programming language.

History

The first public beta of AutoHotkey was released on November 10, 2003. It was based on the syntax on AutoIt v2. It used some AutoIt v3 commands and the AutoIt v3 compiler. AutoIt v3 changed its license from GPL to closed source because of "other projects repeatedly taking AutoIt code" and "setting themselves up as competitors."

In 2010, AutoHotkey v1.1 (originally called AutoHotkey_L) became the platform for ongoing development of AutoHotkey. In late 2012, it became the official branch.

Examples

The following script will allow a user to search for a particular word or phrase using Google. After copying text from any application to the clipboard, pressing the configurable hotkey Win will open the user's default web browser and perform the search.

#g::Run http://www.google.com/search?q=%clipboard%

The following script defines a hotstring that enables the user to type "afaik" in any program and have it automatically replaced with "as far as I know":

::afaik::as far as I know

The example below makes Ctrl replace selected text in an editor with a quoted version of that text. It illustrates the use of functions, arguments and default argument values.

^+q::QuoteSelection()  ; Ctrl+Shift+Q

QuoteSelection()
{
        selection := GetSelection()  ; Get selected text.
        PasteText(Quote(selection))  ; Quote the text and paste it back.
}

GetSelection(timeoutSeconds := 0.5)
{
        Clipboard := ""  ; Clear clipboard for ClipWait to function.
        Send ^c  ; Send Ctrl+C to get selection on clipboard.
        ClipWait %timeoutSeconds% ; Wait for the copied text to arrive at the clipboard.
        return Clipboard
}

PasteText(s)
{
        Clipboard := s  ; Put the text on the clipboard.
        Send ^v  ; Paste the text with Ctrl+V.
}

Quote(s)
{
        return """" . s . """"
}

User-contributed features

There are extensions/interops/inline script libraries available for usage with/from other programming languages:

Other major plugins enable support for:

  • Aspect-oriented programming
    • Function hooks
  • COM wrappers
  • Console interaction
  • Dynamic code generation
  • HIDs
  • Internet Explorer automation
  • GUI creation
  • Web services
  • Synthetic programming
  • Windows event hooks

Malware

Some malware has been written using AutoHotkey.

Anti-malware products sometimes falsely identify AutoHotkey scripts as malware. These are called false positives.

Related pages

  • AutoIt (for Windows)
  • KiXtart (for Windows)
  • Winbatch (for Windows)
  • Macro Express (for Windows)
  • Bookmarklet (for web browsers)
  • iMacros (for Firefox, Chrome, and Internet Explorer)
  • AutoKey (for Linux)
  • Automator (for Macintosh)
  • Keyboard Maestro (for Macintosh)

See also

Kids robot.svg In Spanish: AutoHotkey para niños

kids search engine
AutoHotkey Facts for Kids. Kiddle Encyclopedia.