AutoHotkey
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.[6] The AutoHotkey installation includes a help file. Documentation is available on the internet.[7]
Developer(s) | Chris Mallett, Steve Gray |
---|---|
Initial release | November 10, 2003[1] July 18, 2008 (Steve Gray)[2][3] | (Chris Mallet)
Stable release | 1.1.31.01
/ October 14, 2019[4] |
Preview release | 2.0-a105
/ September 22, 2019[5] |
Repository | |
Operating system | Microsoft Windows |
Type | Scripting language Automation GUI utility |
License | GPL |
Website | autohotkey |
Features
changeAutoHotkey scripts can be used to load programs, open documents, and issue keystrokes and mouse clicks.[8]
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+Alt+I on the keyboard, a script could open a web browser.
Keyboard keys can be remapped, such that pressing Ctrl+N might result in the active window receiving an en dash (–). The same keys could be disabled, such that pressing Ctrl+N might result in nothing happening at all.[9]
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".[10]
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.[11]
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.[12]
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
changeThe first public beta of AutoHotkey was released on November 10, 2003.[1] It was based on the syntax on AutoIt v2. It used some AutoIt v3 commands and the AutoIt v3 compiler.[13] AutoIt v3 changed its license from GPL to closed source because of "other projects repeatedly taking AutoIt code" and "setting themselves up as competitors."[14]
In 2010, AutoHotkey v1.1 (originally called AutoHotkey_L) became the platform for ongoing development of AutoHotkey.[15] In late 2012, it became the official branch.[16]
Examples
changeThe 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::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+⇧ Shift+Q 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
changeThere are extensions/interops/inline script libraries available for usage with/from other programming languages:
- VB/C# (.NET)[17]
- Lua[18]
- Lisp[19]
- ECL[20]
- VBScript/JScript (Windows Scripting Host)[21]
- Embedded machine code[22]
Other major plugins enable support for:
- Aspect-oriented programming
- Function hooks[23]
- COM wrappers[24]
- Console interaction[25]
- Dynamic code generation[26]
- HIDs[27]
- Internet Explorer automation[28]
- GUI creation[29]
- Web services[30]
- Synthetic programming[31]
- Windows event hooks[32]
Malware
changeSome malware has been written using AutoHotkey.[33]
Anti-malware products sometimes falsely identify AutoHotkey scripts as malware. These are called false positives.[34][35][36][37][38][39][40]
Related pages
change- 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)
References
change- ↑ 1.0 1.1 "AutoHotkey Changelog for Years 2003-2004". Autohotkey.com. Archived from the original on 2011-11-04. Retrieved 2011-12-02.
- ↑ "Changes & New Features AutoHotkey (sorted by date)".
- ↑ "L4 Source Code (sorted by date)". GitHub.
- ↑ "AutoHotkey Downloads".
- ↑ "AutoHotkey v2 Downloads (sorted by date)".
- ↑ Contact Erica Sadun: Comment (2005-08-19). "Ericasadun 2005 Life Hacker". Lifehacker.com. Archived from the original on 2005-10-24. Retrieved 2011-12-02.
- ↑ "Quick Reference | AutoHotkey".
- ↑ "AutoHotkey Tutorial: Macro and Hotkey Creation". Autohotkey.com. Retrieved 2011-12-02.
- ↑ "Remapping Keys and Buttons". Autohotkey.com. Retrieved 2011-12-02.
- ↑ "Hotstrings and Auto-replace (similar to AutoText and AutoCorrect)". Autohotkey.com. 2005-01-09. Retrieved 2011-12-02.
- ↑ "Hotkeys, Hotstrings, and Remapping". Autohotkey.com. Retrieved 2018-05-23.
- ↑ "AutoHotkey Changes and New Features, v1.0.47 - June 19, 2007". Autohotkey.com. Retrieved 2011-12-02.
- ↑ "Author Chris Mallett's post on the AutoHotkey Forums". Autohotkey.com. Retrieved 2011-12-02.
- ↑ "Licensing Opinions - AutoIt Forums". Autoitscript.com. Retrieved 2011-12-02.
- ↑ "Forum post by Chris, announcing AutoHotkey_L now main platform". Autohotkey.com. Retrieved 2011-12-02.
- ↑ "The AutoHotkey Foundation : Our History". The AutoHotkey Foundation. 2014-05-26. Retrieved 2016-07-23.
- ↑ .NET Framework
- ↑ LibLua
- ↑ Lisp on win32
- ↑ Embeddable Common Lisp
- ↑ Windows Scripting Host
- ↑ Embedded machine code
- ↑ Function Hooks
- ↑ COM Wrappers
- ↑ Console Interaction (LibCon)
- ↑ Dynamic Code Generation
- ↑ Human Interface Device(HID) Support
- ↑ Internet Explorer Automation
- ↑ SmartGUI Creator
- ↑ Sparrow AHK Web Server
- ↑ Bit Wizardry
- ↑ Windows Event Hooks
- ↑ Research, Cybereason Nocturnus. "Fauxpersky: CredStealer malware written in AutoHotKey masquerades as Kaspersky Antivirus, spreading through infecting USB drives". Retrieved 2018-03-29.
- ↑ "trojan in autohotkey installer?". AutoHotkey Forums. gallaxhar.
- ↑ "False positive virus alert?". AutoHotkey Forums. narny.
- ↑ "False positive on antivirus programs". AutoHotkey Forums. Ferry.
- ↑ "Trojan.Antavmu detected in AutoHotKey". AutoHotkey Forums. apao.
- ↑ "Avast, false positive exe files". AutoHotkey Forums. Doron.
- ↑ "False Positive: Malwarebytes Anti-Malware PRO and Windows 8". AutoHotkey Forums. PuzzledGreatly.
- ↑ "Antivirus scan for AutoHotkey112400_Install.exe". VirusTotal.