Skip to main content Link Search Menu Expand Document (external link)

AutoHotKey

An open-source scripting language for Windows!

Basics

  • Commands cannot be merged into a single file

Triggers

Hotkey is created by single pair of colons

  1. :: if a Hotstring
  2. Key combo like j or Hotstring like btw
  3. ::
  4. Content, like Send, text
  5. return if not only text is used

Input trigger

Keyboard & Mouse

Symbol Description
# Windows key
! Alt key
^ Ctrl key
+ Shift key
& Combine keys/mouse buttons, like Numpad0 & Numpad1::

Window-specific

An action can be enabled in a certain window thanks to a directive (#).
This affects all hotkeys/Hotstring beneath them in the script, and only the most recent is in effect.
More detail in doc

; Untitled - Notepad
#IfWinActive Untitled - Notepad
!q::
MsgBox, You pressed ALT+Q in Notepad.
return

; Any window that isn't Untitled - Notepad
#IfWinActive
!q::
MsgBox, You pressed ALT+Q in any window.
return

Examples

  • Hotkey is a key or key combination that trigger some action

      ^j::
      Send, My first script
      return
    
  • Hotstring expand abbreviations, but can also be used to trigger an action

      ::mail::[email protected]
    

Reference