guides

AutoHotkey on Mac: The Real Equivalents

By Lightning Assist TeamAugust 6, 20268 min read
autohotkeymacmacosalternativeshammerspoonkeyboard-maestrokarabineralfred
Share:

Quick answer: AutoHotkey doesn't run on macOS — like Linux, it's built directly on Windows APIs with no Mac equivalent. For Mac users coming from AHK, the closest matches are Hammerspoon (free, Lua scripting, full automation power), Keyboard Maestro ($36 one-time, GUI macros, the closest to AHK's actual scope), Karabiner-Elements (free, but keyboard remapping only — not text expansion or scripting), and Alfred (Powerpack from £34, launcher + workflows + snippets). None is a drop-in AHK replacement; each covers a different slice of what AHK does. For text expansion and hotkeys specifically, Lightning Assist ($5.99/mo) covers that slice natively on Mac, plus AI commands and voice typing none of the others have.

Disclosure: we make Lightning Assist, a paid text expander, so AutoHotkey is a competitor of ours. AutoHotkey is free and open source, and we've tried to describe it accurately — including the things it does better than we do.

If you're moving from Windows to Mac and searching for "AutoHotkey for Mac," the honest answer is that there isn't one — but macOS actually has more automation tools than Linux does; they're just split across several apps instead of one.

Why AutoHotkey Doesn't Run on Mac

The reason is the same one that keeps AHK off Linux: AutoHotkey is built on Windows-specific mechanisms — low-level keyboard/mouse hooks (SetWindowsHookEx), window messages (SendMessage/PostMessage) for controlling other apps' windows, and DllCall for reaching into arbitrary Windows DLLs and COM objects. macOS has none of these; it has its own automation and accessibility APIs (the Accessibility framework, Apple Events, Quartz Event Services) that are structurally different, not just differently named. Porting AHK's actual codebase would mean rewriting its core around a different OS model, not recompiling for a new target — which is why, after two decades of "will AutoHotkey come to Mac" forum threads, it hasn't happened natively. The closest anyone gets is running the Windows build inside a compatibility layer like CrossOver (built on Wine), with the same hit-or-miss caveats that apply on Linux — compatibility depends on which Win32 APIs a given script actually calls, and it's not an officially supported combination.

Also worth knowing: AutoHotkey v2 is the actively maintained version now — v1.1 is end-of-life. Its final release was v1.1.37.02 in March 2023, and the maintainer has said no further bug fixes or features will land on that branch. If you're referencing old AHK scripts or tutorials, check whether they target v1 or v2 syntax before assuming they still work; see the official AutoHotkey v2 documentation.

💡 Just need text expansion and hotkeys, not full macOS scripting? Lightning Assist runs natively on Apple Silicon and Intel Macs — no scripting required. Try free for 14 days → — no credit card.

The Real Mac Equivalents

Unlike Linux, where AutoKey alone covers most of AHK's territory, macOS splits AHK's job across several specialized tools. Here's what each one actually replaces.

Hammerspoon — Closest to AHK's Scripting Power

Hammerspoon is free, open source, and macOS-only. It bridges macOS's automation APIs to a Lua scripting engine, so you write Lua to control window management, hotkeys, application launching, Wi-Fi and battery events, and more. It's actively developed, with prebuilt plugin bundles ("Spoons") for common tasks.

This is the tool that most resembles AutoHotkey's actual nature: you write code, not click through a GUI. Hammerspoon has no built-in text-expansion/hotstring feature out of the box — you'd write Lua to watch for a trigger string and replace it, which is a real project, not a checkbox. If what drew you to AHK was the scripting itself, Hammerspoon is the honest match. If it was the result — typing a shortcut and getting a snippet — it's more setup than most people want.

Keyboard Maestro — Closest to AHK's Actual Use Case

Keyboard Maestro is $36 one-time for the current major version (v11, 11.1.1 at the time of writing; upgrades from older versions are $25) — no subscription, macOS 10.13 High Sierra or later, native Apple Silicon support. Prices and requirements verified on Stairways Software's own page, August 2026. It's GUI-driven macro software: window control, application automation, text snippet expansion, clipboard manipulation, web form filling, and conditional logic, all built through a visual macro editor rather than a scripting language (though it supports AppleScript and shell scripts for advanced cases).

Of everything here, Keyboard Maestro is the closest to what most people actually mean when they ask for "AutoHotkey for Mac" — broad automation and a GUI, matching AHK's power without requiring you to learn its scripting language. It's genuinely feature-heavy, though, which is overkill if all you want is text expansion.

Karabiner-Elements — Key Remapping, Not Text Expansion

Karabiner-Elements is free (public domain license), macOS-only, and does one thing well: keyboard remapping and "complex modifications" — turning Caps Lock into Control or Escape, building custom modifier-key logic, remapping between keyboard layouts. It is not a text expander or a general scripting tool, and doesn't claim to be. If your AHK scripts were mostly remapping physical keys rather than expanding text or automating windows, Karabiner-Elements is the direct match — for anything else, it's the wrong tool.

Alfred — Launcher First, Automation Second

Alfred is a Spotlight-replacement launcher at its core; its Powerpack add-on (£34 single license, £59 "Mega Supporter" lifetime-upgrades tier, per Alfred's official store) unlocks Workflows — chaining triggers to actions, similar in spirit to AHK's hotkey-to-action model — and Snippets, genuine text expansion with keyword-based auto-expansion, though it ships off by default and has to be turned on in Preferences. Snippets is Powerpack-only; the free version has none.

Alfred is worth considering if you already want a launcher and are willing to have your text expansion live inside it, but it isn't a standalone text expander the way Espanso or Lightning Assist are — it's one feature of a broader productivity app.

Where Lightning Assist Fits

None of the four tools above is a text expander first — Hammerspoon is a scripting environment, Keyboard Maestro is a macro suite, Karabiner-Elements is a key remapper, and Alfred is a launcher with snippets attached. If text expansion and hotkeys are the actual job, that's Lightning Assist's whole focus:

  • Native Mac app, full Apple Silicon support (M1–M4) and Intel
  • As-You-Type expansion by default — type the trigger, it expands inline, no modifier key required. See all activation modes →
  • AI commands (rewrite, enhance, translate selected text) and push-to-talk voice-to-text in any app — none of Hammerspoon, Keyboard Maestro, Karabiner-Elements, or Alfred's Snippets have either
  • Cross-platform — the same snippet library also works on Windows and Linux, unlike every tool above, which is Mac-only
  • Team snippet sharing — share a library with colleagues; none of the four above have a built-in equivalent

Try Lightning Assist free for 14 days on Mac — no credit card required. If you're comparing against Mac-native text expanders specifically rather than AHK-style automation tools, see Lightning Assist vs. Typinator and Lightning Assist vs. aText.

AutoHotkey Feature → Mac Option

What you used AHK for Closest Mac option
Text expansion / hotstrings Lightning Assist (GUI) or Alfred Snippets (Powerpack)
Simple hotkeys Lightning Assist, Keyboard Maestro, or Hammerspoon
Window automation, UI scripting Hammerspoon (Lua) or Keyboard Maestro (GUI macros)
Key remapping (Caps Lock, modifiers) Karabiner-Elements
Running your actual .ahk scripts CrossOver/Wine — hit or miss, especially AHK v2

The Bottom Line

There's no single AutoHotkey for Mac, because AHK's design is inseparable from Windows APIs that don't exist on macOS — its job gets split across several specialized tools instead of one. Hammerspoon replaces the scripting; Keyboard Maestro replaces the broad automation-with-a-GUI; Karabiner-Elements replaces key remapping; Alfred adds snippets to a launcher. If what you actually need is the text-expansion-and-hotkeys slice, Lightning Assist covers that natively on Mac, with AI commands and voice typing none of the AHK-era tools offer.

See also AutoHotkey alternatives across all platforms and Lightning Assist vs. AutoHotkey.

Frequently Asked Questions

Can I run my .ahk scripts on a Mac at all?

Only through a Windows compatibility layer like CrossOver (built on Wine), and only partially — simple hotstrings and hotkeys have a reasonable chance of working, while scripts calling deep Win32 or COM APIs are more likely to fail. This isn't officially supported by the AutoHotkey project for macOS; test your specific script rather than assuming compatibility.

Which Mac tool is closest to AutoHotkey overall?

Keyboard Maestro, if you want AHK's breadth — window control, conditional logic, text expansion — with a GUI instead of a scripting language. Hammerspoon, if you specifically want to write code the way AHK scripts do, via Lua instead of AHK's own language.

Does Karabiner-Elements do text expansion?

No. Karabiner-Elements remaps physical keys and builds complex modifier-key logic — it has no concept of typing a trigger word and getting expanded text. For text expansion on Mac, use Lightning Assist, Alfred's Snippets (Powerpack), Keyboard Maestro, or a dedicated text expander.

Is Alfred's Powerpack worth it just for Snippets?

If snippets are genuinely all you need, probably not — the Powerpack's price is really for the full Workflows automation engine, with Snippets as one feature among many, and auto-expansion has to be manually enabled. A dedicated text expander like Lightning Assist is built around expansion as the core feature rather than an add-on.

Sources