ScriptsMay 20, 2026·3 min read

AutoHotkey — Desktop Automation and Scripting for Windows

AutoHotkey is a free scripting language for Windows that lets you create hotkeys, remap keys, automate repetitive tasks, and build lightweight GUIs with minimal code.

Agent ready

This asset can be read and installed directly by agents

TokRepo exposes a universal CLI command, install contract, metadata JSON, adapter-aware plan, and raw content links so agents can judge fit, risk, and next actions.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
AutoHotkey Overview
Universal CLI install command
npx tokrepo install 62279cf5-5447-11f1-9bc6-00163e2b0d79

Introduction

AutoHotkey (AHK) is a scripting language and interpreter for Windows that enables keyboard shortcuts, macro creation, mouse automation, and custom GUI building. It is widely used by developers, power users, and gamers to automate repetitive tasks, remap keys, and extend the Windows desktop beyond what built-in tools allow.

What AutoHotkey Does

  • Creates global hotkeys and keyboard shortcuts that work across all applications
  • Remaps any key or mouse button to any other key, combination, or script action
  • Automates GUI interactions by sending keystrokes, mouse clicks, and window commands
  • Builds lightweight native Windows GUIs with buttons, text fields, and menus
  • Performs text expansion to replace short abbreviations with longer phrases

Architecture Overview

AutoHotkey v2 is an interpreter written in C++ that executes .ahk script files. Scripts register hotkeys and hotstrings through Windows hooks (keyboard and mouse low-level hooks). When a registered trigger fires, the interpreter runs the associated script block. GUI creation uses the native Win32 API, keeping the runtime footprint small. Scripts can call Windows DLL functions directly via DllCall, interact with COM objects, and manipulate windows through the built-in WinTitle matching system.

Self-Hosting & Configuration

  • Install the interpreter via WinGet, Chocolatey, Scoop, or the official installer
  • Scripts are plain text .ahk files editable in any text editor
  • Place scripts in the Windows Startup folder for automatic execution at login
  • Compile scripts into standalone .exe files with the included Ahk2Exe compiler
  • Use #Include directives to organize larger scripts across multiple files

Key Features

  • Hotkeys and hotstrings respond instantly through low-level Windows input hooks
  • DllCall and ComObject support enables deep Windows system integration
  • Ahk2Exe compiles scripts into standalone executables that run without AHK installed
  • Regular expressions, file I/O, and networking are built into the language
  • Large community library of scripts for window management, text processing, and productivity

Comparison with Similar Tools

  • PowerShell — system administration shell with deeper OS management; AHK specializes in input automation and hotkeys
  • AutoIt — similar Windows automation language; AHK has a more active community and stronger hotkey support
  • PowerToys — GUI-based utilities from Microsoft; AHK offers programmable automation beyond predefined tools
  • xdotool (Linux) — X11 automation tool; AHK is Windows-specific but offers a richer scripting language

FAQ

Q: Does AutoHotkey work on macOS or Linux? A: No. AutoHotkey is Windows-only. On macOS, consider Hammerspoon. On Linux, consider xdotool or sxhkd.

Q: What is the difference between AHK v1 and v2? A: AHK v2 is a significant rewrite with cleaner syntax, consistent function-based commands, and removed legacy behaviors. New scripts should use v2.

Q: Can AutoHotkey scripts be compiled to run without installation? A: Yes. The Ahk2Exe compiler packages scripts into standalone .exe files.

Q: Is AutoHotkey detected as malware by antivirus software? A: Some antivirus tools flag AHK scripts or compiled executables as potentially unwanted due to their input-hooking nature. These are false positives for legitimate scripts.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets