AutoHotkey

Revision as of 13:46, 16 April 2025 by imported>Ogusokumushi (Undid revision 1285904640 by 27.109.15.52 (talk))
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Template:Short description Template:For {{#invoke:Infobox|infobox}}Template:Template other{{#invoke:Check for unknown parameters | check | showblankpositional=1 | unknown = Template:Main other | preview = Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y | AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo upright | logo size | logo title | logo_alt | logo_caption | logo_upright | logo_size | logo_title | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot upright | screenshot size | screenshot title | screenshot_alt | screenshot_upright | screenshot_size | screenshot_title | service_name | size | standard | title | ver layout | website | qid }}Template:Main other

AutoHotkey is a free and open-source custom scripting language for Microsoft Windows, primarily designed to provide easy keyboard shortcuts or hotkeys, fast macro-creation and software automation to allow users of most computer skill levels to automate repetitive tasks in any Windows application. It can easily extend or modify user interfaces (for example, overriding the default Windows control key commands with their Emacs equivalents).<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> The installation package includes an extensive help file; web-based documentation is also available.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

FeaturesEdit

AutoHotkey scripts can be used to launch programs, open documents, and emulate keystrokes or mouse clicks and movements.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> They can also assign, retrieve, and manipulate variables, run loops, and manipulate windows, files, and folders. They can be triggered by a hotkey, such as a script that opens an internet browser when the user presses Template:Key press on the keyboard. Keyboard keys can also be remapped and disabled—for example, so that pressing Template:Key press produces an em dash in the active window.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> AutoHotkey also allows "hotstrings" that automatically replace certain text as it is typed, such as assigning the string "btw" to produce the text "by the way", or the text "%o" to produce "percentage of".<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Scripts can also be set to run automatically at computer startup, with no keyboard action required—for example, for performing file management at a set interval.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

More complex tasks can be achieved with 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 standalone executable files that can be run on other computers without AutoHotkey installed. The C++ source code can be compiled with Visual Studio Express.

AutoHotkey allows memory access through pointers, as in C.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

Some uses for AutoHotkey:

  • Remapping the keyboard, such as from QWERTY to Dvorak and other alternative keyboard layouts
  • Using shortcuts to type frequently-used filenames and other phrases
  • Typing punctuation not available on the keyboard, such as curved quotes ()
  • Typing other non-keyboard characters, such as the sign Template:Char used for dimensional measurement (e.g. 10′×12′)
  • Controlling the mouse cursor with a keyboard or joystick
  • Opening programs, documents, and websites with simple keystrokes
  • Adding a signature to e-mail, message boards, etc.
  • Monitoring a system and automatically closing unwanted programs
  • Scheduling an automatic reminder, system scan or backup
  • Automating repetitive tasks
  • Filling out forms automatically
  • Prototyping applications before implementing them in other, more time-consuming programming languages

HistoryEdit

The first public beta of AutoHotkey was released on November 10, 2003,<ref name="2003to2004changelog" /> after author Chris Mallett's proposal to integrate hotkey support into AutoIt v2 failed to generate response from the AutoIt community.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Mallett built a new program from scratch basing the syntax on AutoIt v2 and using AutoIt v3 for some commands and the compiler.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Later, AutoIt v3 switched from GPL to closed source because of "other projects repeatedly taking AutoIt code" and "setting themselves up as competitors".<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

In 2010, AutoHotkey v1.1 (originally called AutoHotkey_L) became the platform for ongoing development of AutoHotkey.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> In late 2012, it became the official branch.<ref name="ourhistory">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> Another port of the program is AutoHotkey.dll.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> A well known fork of the program is AutoHotkey_H,<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> which has its own subforum on the main site.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

Version 2Edit

In July 2021, the first AutoHotkey v2 beta was released.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> The first release candidate was released on November 20, 2022, with the full release of v2.0.0 planned later in the year.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> On December 20, 2022, version 2.0.0 was officially released.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> On January 22, 2023, AutoHotkey v2 became the official primary version. AutoHotkey v1.1 became legacy and no new features were implemented, but this version was still supported by the site.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> On March 16, 2024, the final update of AutoHotkey v1.1 was released. AutoHotkey v1.1 has now reached its end of life.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

ExamplesEdit

The following script searches for a particular word or phrase using Google. After the user copies text from any application to the clipboard, pressing the configurable hotkey Template:Key press opens the user's default web browser and performs the search.

<syntaxhighlight lang="autohotkey">

  1. g::Run "https://www.google.com/search?q=" . A_Clipboard

</syntaxhighlight>

The following script defines a hotstring that enables the user to type afaik in any program and, when followed by an ending character, automatically replace it with "as far as I know":

<syntaxhighlight lang="autohotkey">

afaik::as far as I know

</syntaxhighlight>

User-contributed featuresEdit

AutoHotKey extensions, interops and inline script libraries are available for use with and from other programming languages, including:

Template:Div col

  • VB/C# (.NET)<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • Lua<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • Lisp<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • ECL<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • Embedded machine code<ref name="auto">{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

|CitationClass=web }}</ref>

Template:Div col end

Other major plugins enable support for:

Template:Div col

|CitationClass=web }}</ref>

  • COM wrappers<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • Console interaction<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • Dynamic code generation<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

  • HIDs<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

|CitationClass=web }}</ref>

  • GUI creation<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

|CitationClass=web }}</ref>

  • Windows event hooks<ref>{{#invoke:citation/CS1|citation

|CitationClass=web }}</ref>

Template:Div col end

MalwareEdit

When AutoHotkey is used to make standalone software for distribution, that software must include the part of AutoHotkey itself that understands and executes AutoHotkey scripts, as it is an interpreted language. Inevitably, some malware has been written using AutoHotkey.<ref>Template:Cite news</ref> When anti-malware products attempt to earmark items of malware that have been programmed using AutoHotkey, they sometimes falsely identify AutoHotkey as the culprit rather than the actual malware.Template:Citation needed

See alsoEdit

Template:Portal

ReferencesEdit

Template:Reflist

External linksEdit