Link Search Menu Expand Document

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 an 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

Symbon 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::mail@example.com
    

Reference