From Wikipedia, the free encyclopedia
  (Redirected from AutoHotKey)
Jump to: navigation, search
AutoHotkey logo.png
Developer(s) Chris Mallett, Steve Gray
Stable release / July 16, 2017; 5 months ago (2017-07-16)[1]
Preview release
2.0-a081 / July 15, 2017; 6 months ago (2017-07-15)[2]
Repository Edit this at Wikidata
Operating system Microsoft Windows
Type Scripting language Automation GUI utility
License GPL

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).[3] The AutoHotkey installation includes its own extensive help file with an always updated web-based version.[4]


AutoHotkey scripts can be used to launch programs, open documents, send keystrokes and mouse clicks and movements.[5] AutoHotkey scripts can also assign, retrieve, and manipulate variables, run loops and manipulate windows, files, and folders. These commands can be triggered by a hotkey, such as a script that would open an internet browser whenever the user presses Ctrl+Alt+i on the keyboard. Keyboard keys can also be remapped or disabled, such that pressing the letter q, for example, might result in the computer receiving a letter r, or nothing at all.[6] AutoHotkey also allows for 'hotstrings' that will automatically replace certain text as it is typed; the most typical use for hotstrings is expanding abbreviations, such as assigning the string "btw" to send the text "by the way" when typed, or the text "%o" to send "percentage of".[7]

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 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.[8]

Common AutoHotkey tasks:

  • 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.
  • 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 in online games.
  • Automating repetitive tasks in Microsoft Excel.
  • Filling out contest and freebie forms automatically (i.e., it can type in your name, address, etc. automatically).
  • Quick code testing before implementing in another (more time consuming) programming language.


The first public beta of AutoHotkey was released on November 10, 2003[9] after author Chris Mallett's proposal to integrate hotkey support into AutoIt v2 failed to generate response from the AutoIt community.[10][11] So the author began his own program from scratch basing the syntax on AutoIt v2 and using AutoIt v3 for some commands and the compiler.[12] Later, AutoIt v3 switched from GPL to closed source because of "other projects repeatedly taking AutoIt code" and "setting themselves up as competitors."[13]

In 2010, AutoHotkey v1.1 (originally called AutoHotkey_L) became the platform for ongoing development of AutoHotkey.[14] Another port of the program is AutoHotkey.dll.[15]


This script swaps control and alt keys.


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+g will open the user's default web browser and perform the search.

#g:: ; Win+g

The following is an example of the script required to create the hotstring "afaik," which is automatically replaced by "as far as I know":

::afaik::as far as I know

The following is an example of a simple function in AutoHotkey. When a URL is copied to the Clipboard, the hotkey Alt+x will check the URL for any/all parentheses and replace them with alternate characters before pasting the URL from the Clipboard:

!x:: ; Alt+x
   Send ^v ; Ctrl+v

URLReplace() {
   StringReplace, Clipboard, Clipboard, (, `%28, All
   StringReplace, Clipboard, Clipboard, ), `%29, All

In this example, once the contents of a user name or IP Address link have been copied from anywhere on Wikipedia's site to the Clipboard (using Firefox), the following script allows a user to perform the function CopyUser on the Clipboard's contents and save it to a variable designated by either the hotkey Ctrl+⇧ Shift+W or the hotkey Ctrl+⇧ Shift+E. The hotkey Ctrl+⇧ Shift+R utilizes the resultant variables to produce a revert edits summary.

^+w::last := CopyUser() ; Ctrl+Shift+w
^+e::edit := CopyUser() ; Ctrl+Shift+e

CopyUser() {
   Clipboard =
   StringReplace, Clipboard, Clipboard,
   StringReplace, Clipboard, Clipboard, wiki/
   StringReplace, Clipboard, Clipboard, w/index.php?title=
   StringReplace, Clipboard, Clipboard, Special:Contributions&target=
   StringReplace, Clipboard, Clipboard, User:
   StringReplace, Clipboard, Clipboard, &action=edit
   StringReplace, Clipboard, Clipboard, _, %A_Space%, All
   Return, Clipboard

; Ctrl+Shift+r
^+r::Send revert edits by [[Special:Contributions/%edit%|%edit%]] to last version by %last%


The online community forum for AutoHotkey has around 27,300 registered users and around 482,000 posts as of January 2012.[16]

The online chat room for AutoHotkey is located on Freenode IRC with an average of 40 connected users as of November 2009.[17]

The administration of the official site has changed.[18][19]

User-contributed features[edit]

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

Other major plugin enable support for:


When AutoHotKey is used to make self-contained software for distribution, that software must include the part of AutoHotKey itself that understands and executes AutoHotKey scripts; it's an interpreted language. Inevitably, some malware has been written using AutoHotKey. 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.[36][37][38][39][40][41][42]

See also[edit]


  1. ^ "AutoHotkey Downloads". 
  2. ^ "AutoHotkey v2 Downloads (sorted by date)". 
  3. ^ Contact Erica Sadun: Comment (2005-08-19). "Ericasadun 2005 Life Hacker". Retrieved 2011-12-02. 
  4. ^
  5. ^ "AutoHotkey Tutorial: Macro and Hotkey Creation". Retrieved 2011-12-02. 
  6. ^ "Remapping Keys and Buttons". Retrieved 2011-12-02. 
  7. ^ "Hotstrings and Auto-replace (similar to AutoText and AutoCorrect)". 2005-01-09. Retrieved 2011-12-02. 
  8. ^ "AutoHotkey Changes and New Features, v1.0.47 - June 19, 2007". Retrieved 2011-12-02. 
  9. ^ "AutoHotkey Changelog for Years 2003-2004". Archived from the original on 2011-11-04. Retrieved 2011-12-02. 
  10. ^ "Author Chris Mallett's post on the AutoHotkey Forums". Retrieved 2011-12-02. 
  11. ^ "An AutoIt / AutoHotkey nonfunctional comparison". Retrieved 2011-12-02. 
  12. ^ "Author Chris Mallett's post on the AutoHotkey Forums". Retrieved 2011-12-02. 
  13. ^ "Licensing Opinions - AutoIt Forums". Retrieved 2011-12-02. 
  14. ^ "Forum post by Chris, announcing AutoHotkey_L now main platform". Retrieved 2011-12-02. 
  15. ^ "AutoHotekey.dll Module". Retrieved 13 May 2017. 
  16. ^ "AutoHotkey Community Forum Page". Retrieved 2011-12-02. 
  17. ^ "Getting connected to AutoHotkey's IRC Chat". Retrieved 2011-12-02. 
  18. ^ "The AutoHotkey Foundation : Our History". The AutoHotkey Foundation. 2014-05-26. Retrieved 2016-07-23. 
  19. ^ "The future of". Chris. 2012-01-26. Retrieved 2012-02-01. 
  20. ^ .NET Framework
  21. ^ LibLua
  22. ^ Lisp on win32
  23. ^ Embeddable Common Lisp
  24. ^ Windows Scripting Host
  25. ^ Embedded machine code
  26. ^ Function Hooks
  27. ^ COM Wrappers
  28. ^ Console Interaction (LibCon)
  29. ^ Dynamic Code Generation
  30. ^ Human Interface Device(HID) Support
  31. ^ Internet Explorer Automation
  32. ^ SmartGUI Creator
  33. ^ Sparrow AHK Web Server
  34. ^ Bit Wizardry
  35. ^ Windows Event Hooks
  36. ^ "trojan in autohotkey installer?". AutoHotkey Forums. gallaxhar. 
  37. ^ "False positive virus alert?". AutoHotkey Forums. narny. 
  38. ^ "False positive on antivirus programs". AutoHotkey Forums. Ferry. 
  39. ^ "Trojan.Antavmu detected in AutoHotKey". AutoHotkey Forums. apao. 
  40. ^ "Avast, false positive exe files". AutoHotkey Forums. Doron. 
  41. ^ "False Positive: Malwarebytes Anti-Malware PRO and Windows 8". AutoHotkey Forums. PuzzledGreatly. 
  42. ^ "Antivirus scan for AutoHotkey112400_Install.exe". VirusTotal. 

External links[edit]