ahk

.ahkAutoHotkey Script

AutoHotkey Community · 2001

Developer
AutoHotkey Community
Category
Programming
MIME Type
text/ahk
First Released
2001
Open Format
Yes
File Signature
N/A
At a Glance
.ahk
AutoHotkey Script

AHK files are scripts used to automate tasks, create custom shortcuts, and remap keys on Windows.

Reviewed on June 11, 2026
Compression
Plain text
Transparency
N/A
Editability
High
Best for
Task automation

Key Features

  • Customizable hotkeys and hotstrings for text expansion and command shortcuts.
  • Powerful automation capabilities for repetitive tasks and application control.
  • User-friendly scripting language with a large, supportive community.
  • Ability to create simple GUIs for custom applications and tools.

Best For

  • Windows users looking to automate repetitive tasks.
  • Users who want to create custom keyboard shortcuts.
  • Gamers seeking to optimize in-game controls.
  • Programmers needing to quickly prototype simple automation scripts.

Less Ideal For

  • Cross-platform applications (scripts are Windows-specific).
  • Complex graphical user interface development.
  • System-level programming or driver development.
  • Creating standalone executable applications without the AutoHotkey interpreter.

Common Use Cases

  • Automating form filling in web browsers or applications.
  • Creating custom keyboard shortcuts for complex software.
  • Remapping keys on a keyboard to improve ergonomics or accessibility.
  • Launching frequently used programs or files with a single command.
  • Building simple custom tools or utilities for personal use.

How to Open It

  1. Download and install the AutoHotkey interpreter from the official website (autohotkey.com).
  2. Right-click on an .ahk file and select 'Open with...' then choose 'AutoHotkey Script'.
  3. Double-click the .ahk file to run the script; it will appear in the system tray.
  4. Edit the script by right-clicking the .ahk file and selecting 'Edit Script' to open it in a text editor.

What is a .ahk file?

AutoHotkey (AHK) is a free, open-source scripting language for Windows. It allows users to automate tasks by creating hotkeys for keystrokes, mouse movements, and program launches. You can remap keys, assign complex commands to simple shortcuts, and even create custom graphical user interfaces. Its flexibility makes it a powerful tool for both basic productivity enhancements and advanced automation projects, catering to users of all technical skill levels.

Programs That Open .ahk Files

PlatformProgram
WindowsAutoHotkeyFreeOfficial
Notepad++Free
Visual Studio CodeFree

Common Problems with .ahk Files

⚠️ Script not running or behaving as expected.
Ensure the AutoHotkey interpreter is installed and running. Check script syntax for errors and test individual commands. Ensure the script is located in a directory with sufficient permissions.
⚠️ Hotkeys conflict with other applications.
Modify the hotkey in the .ahk script to use a different key combination. You can also add context-sensitive hotkeys that only trigger within specific windows.

Frequently Asked Questions

Can I run .ahk scripts on macOS or Linux?

No, AutoHotkey is a Windows-specific scripting language. There are alternative automation tools for other operating systems, such as AutoKey for Linux or Keyboard Maestro for macOS, but they are not directly compatible with .ahk files.

Do I need to compile .ahk files?

No, .ahk files are interpreted directly by the AutoHotkey program. You can optionally compile them into standalone .exe files using the 'Ahk2Exe' tool, which bundles the interpreter with your script.

Are .ahk scripts safe to run?

AutoHotkey scripts are generally safe, but like any executable code, they can perform actions on your system. Only run scripts from trusted sources and review the code if possible to understand what it does.

Technical Details

AHK scripts are plain text files containing commands and logic that the AutoHotkey interpreter executes. The syntax is designed to be intuitive, allowing users to define hotkeys, hotstrings, and custom functions. The interpreter compiles these scripts into bytecode on the fly for execution, making them highly dynamic and responsive without requiring a traditional compilation step.

Did You Know?

AutoHotkey was created by Chris Mallett to automate tasks he found tedious on Windows.
The language is highly extensible, allowing users to create complex applications and even games.

Security Information

AutoHotkey scripts can execute commands on your system. Always be cautious when running scripts from unknown or untrusted sources, as they could potentially perform malicious actions.

Related Extensions