Home

AHK2

AHK2 refers to AutoHotkey version 2, the second major branch of the AutoHotkey scripting language designed for Windows automation. It was released as a redesigned, more consistent successor to AutoHotkey v1, with the aim of improving reliability, readability, and maintainability of scripts. AHK2 introduces a function-centric syntax, mandatory parentheses for function calls, and standardized parameter handling, which together make the language more explicit but also break backward compatibility with most v1 scripts.

History and development: AutoHotkey began as a free, open-source automation tool for Windows developed by various

Features and design: AHK2 reorganizes many built-in commands into a more uniform function-based model. It uses

Compatibility and migration: AHK2 is not fully backward compatible with v1. Developers are encouraged to port

contributors,
with
Lexikos
and
the
core
community
playing
a
central
role
in
AHK2’s
design
and
maintenance.
The
first
stable
release
of
v2
occurred
around
2020,
and
since
then
the
v2
branch
has
continued
to
evolve
alongside
the
traditional
v1
branch,
receiving
updates
and
refinements
to
address
usability
and
consistency
concerns.
the
assignment
operator
:=,
enforces
explicit
function
calls
with
parentheses,
and
provides
improved
error
handling
and
debugging
facilities.
The
language
preserves
the
core
capabilities
of
AutoHotkey,
including
hotkeys,
hotstrings,
GUI
automation,
and
script-based
automation,
while
reworking
parameter
semantics
and
syntax
to
reduce
ambiguity.
Type
handling
remains
dynamic,
but
the
revised
syntax
supports
clearer
code
structure
and
easier
maintenance.
existing
scripts
using
the
provided
porting
tools
and
documentation,
though
some
v1
constructs
require
changes
or
alternative
approaches
in
v2.
The
project
supports
coexistence
of
both
versions,
with
separate
runtimes
and
resources
for
users
transitioning
between
them.