AutoHotkey

{{Short description|Automation-focused scripting language for Windows}}

{{for|the use of AutoHotkey by Wikipedia editors|:Wikipedia:AutoHotkey|selfref=y}}

{{Infobox software

| name = AutoHotkey

| logo = Modern AutoHotkey Logo (no text).svg

| screenshot =

| caption =

| developer = Chris Mallett, Steve Gray

| released = {{Start date and age|2003|11|10}} (Chris Mallet){{cite web|url=http://www.autohotkey.com/changelog/2004.htm |title=AutoHotkey Changelog for Years 2003-2004 |publisher=Autohotkey.com |access-date=2011-12-02 |url-status=dead |archive-url=https://web.archive.org/web/20111104142142/http://www.autohotkey.com/changelog/2004.htm |archive-date=2011-11-04 }}
{{Start date and age|2008|7|18}} (Steve Gray){{Cite web|url=https://www.autohotkey.com/docs/AHKL_ChangeLog.htm#L4|title=Changes & New Features | AutoHotkey|website=www.autohotkey.com}}{{Cite web|url=https://github.com/Lexikos/AutoHotkey_L|title=Lexikos/AutoHotkey_L|website=GitHub}}

| latest_release_version = {{wikidata|property|preferred|references|edit|P348|P548=Q2804309}}

| latest_release_date = {{Start date and age|{{wikidata|qualifier|preferred|single|P348|P548=Q2804309|P577}}}}

| operating_system = Microsoft Windows

| genre = Scripting language Automation GUI utility

| license = GPLv2{{cite web| url=https://www.autohotkey.com/docs/license.htm| title=Software License| publisher={{PAGENAME}}| accessdate=2022-06-08| quote=GNU GENERAL PUBLIC LICENSE Version 2, June 1991}}

| website = {{official URL}}

}}

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).{{cite web|author=Contact Erica Sadun: Comment |url=http://lifehacker.com/software/software/download-of-the-day-autohotkey-118270.php |title=Ericasadun 2005 Life Hacker |publisher=Lifehacker.com |date=2005-08-19 |access-date=2011-12-02}} The installation package includes an extensive help file; web-based documentation is also available.{{Cite web|url=https://www.autohotkey.com/docs/AutoHotkey.htm|title=Quick Reference | AutoHotkey|website=www.autohotkey.com}}

Features

AutoHotkey scripts can be used to launch programs, open documents, and emulate keystrokes or mouse clicks and movements.{{cite web |url=http://www.autohotkey.com/docs/Tutorial.htm |title=AutoHotkey Tutorial: Macro and Hotkey Creation |publisher=Autohotkey.com |access-date=2011-12-02}} 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 {{key press|Ctrl|Alt|I}} on the keyboard. Keyboard keys can also be remapped and disabled—for example, so that pressing {{key press|Ctrl|M}} produces an em dash in the active window.{{cite web |url=http://www.autohotkey.com/docs/misc/Remap.htm |title=Remapping Keys and Buttons |publisher=Autohotkey.com |access-date=2011-12-02}} 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".{{cite web |url=http://www.autohotkey.com/docs/Hotstrings.htm |title=Hotstrings and Auto-replace (similar to AutoText and AutoCorrect) |publisher=Autohotkey.com |date=2005-01-09 |access-date=2011-12-02}} 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.{{cite web |url=https://autohotkey.com/docs/FAQ.htm#Startup |title=Hotkeys, Hotstrings, and Remapping |publisher=Autohotkey.com |access-date=2018-05-23}}

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.{{cite web |url=http://www.autohotkey.com/changelog/ |title=AutoHotkey Changes and New Features, v1.0.47 - June 19, 2007 |publisher=Autohotkey.com |access-date=2011-12-02}}

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 {{char|×}} used for dimensional measurement (e.g. 10′×12′)
  • Simulating mouse cursor input via a script or keystrokes
  • Opening programs, documents, and websites with simple keystrokes
  • Pasting text strings on command (e.g. adding signatures to e-mails, message boards posts, etc.)
  • Monitoring a system and automatically closing unwanted programs
  • Scheduling an automatic reminder, system scan, or backup
  • Filling out forms automatically
  • Prototyping applications before implementing them in other, more time-consuming programming languages

History

The first public beta of AutoHotkey was released on November 10, 2003, after author Chris Mallett's proposal to integrate hotkey support into AutoIt v2 failed to generate response from the AutoIt community.{{cite web |url=http://www.autohotkey.com/forum/viewtopic.php?p=20176#20176 |title=Author Chris Mallett's post on the AutoHotkey Forums |publisher=Autohotkey.com |access-date=2011-12-02}}{{cite web |url=http://paperlined.org/apps/autohotkey/autoit_and_autohotkey.html |title=An AutoIt / AutoHotkey nonfunctional comparison |publisher=Paperlined.org |access-date=2011-12-02 |archive-url=https://web.archive.org/web/20111208181846/http://paperlined.org/apps/autohotkey/autoit_and_autohotkey.html |archive-date=2011-12-08 |url-status=dead }} Mallett built a new program from scratch basing the syntax on AutoIt v2 and using AutoIt v3 for some commands and the compiler.{{cite web |url=http://www.autohotkey.com/forum/viewtopic.php?p=19710#19710 |title=Author Chris Mallett's post on the AutoHotkey Forums |publisher=Autohotkey.com |access-date=2011-12-02}} Later, AutoIt v3 switched from GPL to closed source because of "other projects repeatedly taking AutoIt code" and "setting themselves up as competitors".{{cite web |url=http://www.autoitscript.com/forum/index.php?showtopic=7204 |title=Licensing Opinions - AutoIt Forums |publisher=Autoitscript.com |access-date=2011-12-02}}

In 2010, AutoHotkey v1.1 (originally called AutoHotkey_L) became the platform for ongoing development of AutoHotkey.{{cite web |url=http://www.autohotkey.com/forum/viewtopic.php?t=63474 |title=Forum post by Chris, announcing AutoHotkey_L now main platform |publisher=Autohotkey.com |access-date=2011-12-02}} In late 2012, it became the official branch.{{cite web |url=http://autohotkey.com/foundation/history.html |title=Our History |publisher=The AutoHotkey Foundation |date=2014-05-26 |access-date=2016-07-23}} Another port of the program is AutoHotkey.dll.{{cite web |url=https://hotkeyit.github.io/v2/docs/AutoHotkeyDll.htm |title=AutoHotekey.dll Module |website=github.io |access-date=2017-05-13}} A well known fork of the program is AutoHotkey_H,{{cite web |url=https://github.com/HotKeyIt/ahkdll-v1-release |title=Hotkeyit's AutoHotkey_H fork |website=GitHub}}{{cite web |url=https://github.com/thqby/AutoHotkey_H |title=Thqby's AutoHotkey_H fork |website=GitHub}} which has its own subforum on the main site.{{cite web |url=https://www.autohotkey.com/boards/viewforum.php?f=65&sid=0c0df0bbedf6f0f896d40ff67119d7c0 |title=AutoHotkey_H subforum |website=AutoHotkey.com}}

=Version 2=

In July 2021, the first AutoHotkey v2 beta was released.{{cite web |url=https://www.autohotkey.com/v2/ |title=AutoHotkey v2|publisher=AutoHotkey.com |access-date=2021-07-28}}{{Cite web|title=AutoHotkey v2.0-beta.1 - AutoHotkey Community|url=https://www.autohotkey.com/boards/viewtopic.php?f=24&t=93011|access-date=2022-01-11|website=www.autohotkey.com}} The first release candidate was released on November 20, 2022, with the full release of v2.0.0 planned later in the year.{{cite web |url=https://www.autohotkey.com/boards/viewtopic.php?f=24&t=110696 |title=AutoHotkey v2.0-rc.1|publisher=AutoHotkey.com |access-date=2022-11-20}}

On December 20, 2022, version 2.0.0 was officially released.{{cite web |url=https://www.autohotkey.com/boards/viewtopic.php?f=24&t=111779 |title=AutoHotkey v2.0.0|publisher=AutoHotkey.com |access-date=2022-12-20}} 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.{{cite web |url=https://www.autohotkey.com/boards/viewtopic.php?f=24&p=503457#p503457 |title=AutoHotkey v2 Official Release Announcement|website=AutoHotkey.com}} On March 16, 2024, the final update of AutoHotkey v1.1 was released. AutoHotkey v1.1 has now reached its end of life.{{cite web |url=https://www.autohotkey.com/boards/viewtopic.php?t=127382 |title=End of Life: v1.1|website=AutoHotkey.com}}

Examples

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 {{key press|Win|G}} opens the user's default web browser and performs the search.

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

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":

::afaik::as far as I know

User-contributed features

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

{{div col}}

  • VB/C# (.NET){{Cite web|url=http://autohotkey.com/board/topic/23884-net-framework-interop/|title=.NET Framework Interop - Scripts and Functions|website=AutoHotkey Community}}
  • Lua{{Cite web|url=http://autohotkey.com/board/topic/40690-ahk-lua-interop-stdlib-proof-of-concept/|title=AHK + LUA Interop (stdlib), proof of concept - Scripts and Functions|website=AutoHotkey Community}}
  • Lisp{{Cite web|url=http://autohotkey.com/board/topic/39620-ahklisp-lisp-on-win32-with-cffi-sbcl-and-autohotkey/|title=ahklisp: lisp on win32 with cffi, sbcl, and autohotkey - Scripts and Functions|website=AutoHotkey Community}}
  • ECL{{Cite web|url=http://autohotkey.com/board/topic/33182-ahkecl-embedded-common-lisp-in-ahk/|title=ahkecl : Embedded common lisp in ahk - Scripts and Functions|website=AutoHotkey Community}}
  • Embedded machine code{{Cite web|url=http://autohotkey.com/board/topic/19483-machine-code-functions-bit-wizardry/|title=Machine code functions: Bit Wizardry - Scripts and Functions|website=AutoHotkey Community}}
  • VBScript/JScript (Windows Scripting Host){{Cite web|url=http://autohotkey.com/board/topic/19963-embedded-windows-scripting-vbscript-jscript-and-com/|title=Embedded Windows Scripting (VBScript & JScript) and COM - Scripts and Functions|website=AutoHotkey Community}}

{{div col end}}

Other major plugins enable support for:

{{div col}}

  • Aspect-oriented programming
  • Function hooks{{Cite web|url=http://autohotkey.com/board/topic/36560-function-hooks/|title=function hooks - Suggestions|website=AutoHotkey Community}}
  • COM wrappers{{Cite web|url=http://autohotkey.com/board/topic/21142-com-standard-library/|title=COM Standard Library - Scripts and Functions|website=AutoHotkey Community}}
  • Console interaction{{Cite web|url=http://autohotkey.com/board/topic/96895-libcon-autohotkey-library-for-console-support/|title=LibCon - AutoHotkey Library For Console Support - Scripts and Functions|website=AutoHotkey Community}}
  • Dynamic code generation{{Cite web|url=http://autohotkey.com/board/topic/23984-lowlevel-dynamic-code/|title=LowLevel & dynamic code - Scripts and Functions|website=AutoHotkey Community}}
  • HIDs{{Cite web|url=http://www.autohotkey.net/~Micha/HIDsupport/Autohotkey.html|title=Human Interface Device(HID) Support}}
  • Internet Explorer automation{{Cite web|url=http://autohotkey.com/board/topic/27950-automation-ie7-navigation-and-scripting-with-tabs/|title=Automation IE7 Navigation and Scripting with Tabs - Scripts and Functions|website=AutoHotkey Community}}
  • GUI creation{{Cite web|url=http://autohotkey.com/board/topic/738-smartgui-creator/|title=:: SmartGUI Creator :: - Scripts and Functions|website=AutoHotkey Community}}
  • Synthetic programming
  • Web services{{Cite web|url=http://autohotkey.com/board/topic/33020-sparrow-ahk-webserver-w-ahk-in-html-support-sources-incl/|title=Sparrow: AHK WebServer w/ AHK in HTML support (sources incl) - Scripts and Functions|website=AutoHotkey Community}}
  • Windows event hooks{{Cite web|url=http://autohotkey.com/board/topic/32662-tool-wineventhook-messages/|title=[tool] WinEventHook Messages - Scripts and Functions|website=AutoHotkey Community}}

{{div col end}}

Malware

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.{{Cite news|url=https://www.cybereason.com/blog/fauxpersky-credstealer-malware-autohotkey-kaspersky-antivirus|title=Fauxpersky: CredStealer malware written in AutoHotKey masquerades as Kaspersky Antivirus, spreading through infecting USB drives|last=Research|first=Cybereason Nocturnus|access-date=2018-03-29}} 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.{{citation needed|date=December 2023}}

See also

{{Portal|Free and open-source software}}

References

{{Reflist}}