AutoHotkey

From Wikipedia, the free encyclopedia

AutoHotKey
Developer: Chris Mallett
Latest release: 1.0.46.00 / November 29, 2006
OS: Microsoft Windows
Use: Automation GUI utility
License: GPL
Website: http://www.autohotkey.com/

AutoHotkey is a free, open source macro and automation software which allows users to automate repetitive tasks and modify the Windows user interface. It is driven by a custom scripting language that is aimed specifically at providing keyboard shortcuts or hot keys, and is intended to be backwards compatible with the AutoIt2 language.

Many simple and repetitive tasks can be automated with this system. Scripts can launch a program or document, send keystrokes and mouse clicks, set and retrieve variables, run loops, and manipulate windows, files, and folders. A side effect of setting hotkeys is that keys can be remapped or disabled. AutoHotkey also allows hotstrings such as "btw" to be replaced as they are typed (with "by the way" for example).

More complex tasks can be achieved with custom data entry forms (GUIs), working with the registry, or using the Windows own API by calling the DLLs. The scripts can be compiled to an executable file that can be run on computers that don't have AutoHotkey installed.

A list of other tasks AutoHotkey could be used for:

  • to be able to use handy shortcuts for often used folder names
  • to more easily search for movies on Internet Movie Database
  • to move around windows on the desktop with the keyboard only
  • to move around windows with the mouse that you normally can't move at all
  • to use shortcuts for often used and complex URLs (that work in IE, Firefox and IRC!)
  • to open URLs from the clipboard in less than a second
  • to easily use different signatures in emails or add info to the signature
  • to close a program window that needs to be sitting in AutoStart but won't close itself when it's done
  • to automatically backup very important files once a day
  • to remap keys, game controller buttons, and mouse buttons
  • to make Ctrl-TAB work in tabbed programs that don't support Ctrl-TAB by themselves
  • to use your game controller as a mouse or keyboard, keyboard as a game controller or mouse, mouse as a game controller or keyboard.
  • to handle text processing and reformatting tasks, via its useful string functions and support for regular expressions (since ver 1.0.45)

[edit] Examples

The following scripts allow the user to search for a particular word or phrase using Google or Wikipedia. After selecting the text from any application, pressing the configurable hotkey will open the default browser and perform the search.

Hotkey is Win + g
#g::
  Send, ^c
  Run, http://www.google.com/search?q=%Clipboard%
Return
Hotkey is Win + w
#w::
  Send, ^c
  Run, http://en.wikipedia.org/wiki/Special:Search?search=%Clipboard%
Return

AutoHotkey is often used to automate typing. For example the following script allows a Wikipedian using Firefox to right click on a user name or IP link and copy its value into variables with the hotkeys CTRL-SHIFT-W and CTRL-SHIFT-E. Then with the hotkey CTRL-SHIFT-R, the program uses the variables to produce an edit summary.

^+w::last := CopyUser( )
^+e::edit := CopyUser( )

CopyUser( )
{
   Clipboard =
   Send, ^c
   StringReplace, Clipboard, Clipboard, http://en.wikipedia.org/
   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
}

^+r::Send revert edits by [[Special:Contributions/it%|it%]] to last version by %last%

[edit] See also

[edit] External links

In other languages