Software:AutoHotkey

From HandWiki
Short description: Automation-focused scripting language for Windows
AutoHotkey
Modern AutoHotkey Logo (no text).svg
Developer(s)Chris Mallett, Steve Gray
Initial releaseNovember 10, 2003; 20 years ago (2003-11-10) (Chris Mallet)[1]
July 18, 2008; 15 years ago (2008-07-18) (Steve Gray)[2][3]
Stable release
v2.0.11 / December 23, 2023; 1 month ago (2023-12-23)[4]
Operating systemMicrosoft Windows
TypeScripting language Automation GUI utility
LicenseGPLv2[5]
Website{{{1}}}

AutoHotkey is a free and 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).[6] The AutoHotkey installation includes its own extensive help file, and web-based documentation is also available.[7]

Features

AutoHotkey scripts can be used to launch programs, open documents, and emulate keystrokes or mouse clicks and movements.[8] 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 on the keyboard. Keyboard keys can also be remapped or disabled, such that pressing , for example, might result in the active window receiving an em dash or nothing at all.[9] AutoHotkey also allows for "hotstrings" that will automatically replace certain text as it is typed, such as assigning the string "btw" to produce the text "by the way" when typed, or the text "%o" to produce "percentage of".[10] Further, scripts can be initiated automatically at computer startup and need not interact with the keyboard at all, perhaps performing file manipulation at a set interval.[11]

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.[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 ().
  • Typing other non-keyboard characters such as the sign × used, e.g., in describing a room as 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 before implementing in another, more time-consuming, programming language.

History

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

In 2010, AutoHotkey v1.1 (originally called AutoHotkey_L) became the platform for ongoing development of AutoHotkey.[17] In late 2012, it became the official branch.[18] Another port of the program is AutoHotkey.dll.[19] A well known fork of the program is AutoHotkey_H,[20][21] which has its own subforum on the main site.[22]

Version 2

In July 2021, the first AutoHotkey v2 beta was released.[23][24] The first release candidate was released on November 20, 2022, with the full release of v2.0.0 planned later in the year.[25] On December 20, 2022, version 2.0.0 was officially released.[26] On January 22, 2023, AutoHotkey v2 became the official primary version. AutoHotkey v1.1 became legacy and no new features will be implemented, but will still be supported by the site and maintenance releases are possible.[27]

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

#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, have it automatically replaced with "as far as I know":

::afaik::as far as I know

User-contributed features

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



Other major plugins enable support for:



Malware

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, as it is an interpreted language. Inevitably, some malware has been written using AutoHotkey.[43] 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]

See also

References

  1. 1.0 1.1 "AutoHotkey Changelog for Years 2003-2004". Autohotkey.com. http://www.autohotkey.com/changelog/2004.htm. 
  2. "Changes & New Features | AutoHotkey". https://www.autohotkey.com/docs/AHKL_ChangeLog.htm#L4. 
  3. "Lexikos/AutoHotkey_L". https://github.com/Lexikos/AutoHotkey_L. 
  4. "AutoHotkey Changes & New Features". https://www.autohotkey.com/docs/v2/ChangeLog.htm. 
  5. "Software License". AutoHotkey. https://www.autohotkey.com/docs/license.htm. Retrieved 2022-06-08. "GNU GENERAL PUBLIC LICENSE Version 2, June 1991" 
  6. Contact Erica Sadun: Comment (2005-08-19). "Ericasadun 2005 Life Hacker". Lifehacker.com. http://lifehacker.com/software/software/download-of-the-day-autohotkey-118270.php. 
  7. "Quick Reference | AutoHotkey". https://www.autohotkey.com/docs/AutoHotkey.htm. 
  8. "AutoHotkey Tutorial: Macro and Hotkey Creation". Autohotkey.com. http://www.autohotkey.com/docs/Tutorial.htm. 
  9. "Remapping Keys and Buttons". Autohotkey.com. http://www.autohotkey.com/docs/misc/Remap.htm. 
  10. "Hotstrings and Auto-replace (similar to AutoText and AutoCorrect)". Autohotkey.com. 2005-01-09. http://www.autohotkey.com/docs/Hotstrings.htm. 
  11. "Hotkeys, Hotstrings, and Remapping". Autohotkey.com. https://autohotkey.com/docs/FAQ.htm#Startup. 
  12. "AutoHotkey Changes and New Features, v1.0.47 - June 19, 2007". Autohotkey.com. http://www.autohotkey.com/changelog/. 
  13. "Author Chris Mallett's post on the AutoHotkey Forums". Autohotkey.com. http://www.autohotkey.com/forum/viewtopic.php?p=20176#20176. 
  14. "An AutoIt / AutoHotkey nonfunctional comparison". Paperlined.org. http://paperlined.org/apps/autohotkey/autoit_and_autohotkey.html. 
  15. "Author Chris Mallett's post on the AutoHotkey Forums". Autohotkey.com. http://www.autohotkey.com/forum/viewtopic.php?p=19710#19710. 
  16. "Licensing Opinions - AutoIt Forums". Autoitscript.com. http://www.autoitscript.com/forum/index.php?showtopic=7204. 
  17. "Forum post by Chris, announcing AutoHotkey_L now main platform". Autohotkey.com. http://www.autohotkey.com/forum/viewtopic.php?t=63474. 
  18. "Our History". The AutoHotkey Foundation. 2014-05-26. http://autohotkey.com/foundation/history.html. 
  19. "AutoHotekey.dll Module". https://hotkeyit.github.io/v2/docs/AutoHotkeyDll.htm. 
  20. "Hotkeyit's AutoHotkey_H fork". https://github.com/HotKeyIt/ahkdll-v1-release. 
  21. "Thqby's AutoHotkey_H fork". https://github.com/thqby/AutoHotkey_H. 
  22. "AutoHotkey_H subforum". https://www.autohotkey.com/boards/viewforum.php?f=65&sid=0c0df0bbedf6f0f896d40ff67119d7c0. 
  23. "AutoHotkey v2". AutoHotkey.com. https://www.autohotkey.com/v2/. 
  24. "AutoHotkey v2.0-beta.1 - AutoHotkey Community". https://www.autohotkey.com/boards/viewtopic.php?f=24&t=93011. 
  25. "AutoHotkey v2.0-rc.1". AutoHotkey.com. https://www.autohotkey.com/boards/viewtopic.php?f=24&t=110696. 
  26. "AutoHotkey v2.0.0". AutoHotkey.com. https://www.autohotkey.com/boards/viewtopic.php?f=24&t=111779. 
  27. "AutoHotkey v2 Official Release Announcement". https://www.autohotkey.com/boards/viewtopic.php?f=24&p=503457#p503457. 
  28. ".NET Framework Interop - Scripts and Functions". http://autohotkey.com/board/topic/23884-net-framework-interop/. 
  29. "AHK + LUA Interop (stdlib), proof of concept - Scripts and Functions". http://autohotkey.com/board/topic/40690-ahk-lua-interop-stdlib-proof-of-concept/. 
  30. "ahklisp: lisp on win32 with cffi, sbcl, and autohotkey - Scripts and Functions". http://autohotkey.com/board/topic/39620-ahklisp-lisp-on-win32-with-cffi-sbcl-and-autohotkey/. 
  31. "ahkecl : Embedded common lisp in ahk - Scripts and Functions". http://autohotkey.com/board/topic/33182-ahkecl-embedded-common-lisp-in-ahk/. 
  32. 32.0 32.1 "Machine code functions: Bit Wizardry - Scripts and Functions". http://autohotkey.com/board/topic/19483-machine-code-functions-bit-wizardry/. 
  33. "Embedded Windows Scripting (VBScript & JScript) and COM - Scripts and Functions". http://autohotkey.com/board/topic/19963-embedded-windows-scripting-vbscript-jscript-and-com/. 
  34. "function hooks - Suggestions". http://autohotkey.com/board/topic/36560-function-hooks/. 
  35. "COM Standard Library - Scripts and Functions". http://autohotkey.com/board/topic/21142-com-standard-library/. 
  36. "LibCon - AutoHotkey Library For Console Support - Scripts and Functions". http://autohotkey.com/board/topic/96895-libcon-autohotkey-library-for-console-support/. 
  37. "LowLevel & dynamic code - Scripts and Functions". http://autohotkey.com/board/topic/23984-lowlevel-dynamic-code/. 
  38. "Human Interface Device(HID) Support". http://www.autohotkey.net/~Micha/HIDsupport/Autohotkey.html. 
  39. "Automation IE7 Navigation and Scripting with Tabs - Scripts and Functions". http://autohotkey.com/board/topic/27950-automation-ie7-navigation-and-scripting-with-tabs/. 
  40. ":: SmartGUI Creator :: - Scripts and Functions". http://autohotkey.com/board/topic/738-smartgui-creator/. 
  41. "Sparrow: AHK WebServer w/ AHK in HTML support (sources incl) - Scripts and Functions". http://autohotkey.com/board/topic/33020-sparrow-ahk-webserver-w-ahk-in-html-support-sources-incl/. 
  42. "[tool WinEventHook Messages - Scripts and Functions"]. http://autohotkey.com/board/topic/32662-tool-wineventhook-messages/. 
  43. Research, Cybereason Nocturnus. "Fauxpersky: CredStealer malware written in AutoHotKey masquerades as Kaspersky Antivirus, spreading through infecting USB drives". https://www.cybereason.com/blog/fauxpersky-credstealer-malware-autohotkey-kaspersky-antivirus. 

External links