{"schemaVersion":"1.0","record":{"label":"Hammerspoon","description":"Hammerspoon tool for keyboard-driven desktop automation or reusable text expansion.","aliases":[],"kind":"software","website":"https://www.hammerspoon.org/","overview":"Hammerspoon is an open-source macOS automation environment that connects a Lua scripting engine to operating-system APIs. It can coordinate windows, applications, input, clipboard data and system events. It does not provide a finished workflow immediately after installation: users supply a Lua configuration or load suitable extensions.","license":"MIT","lifecycle":"active","example":false,"features":[{"name":"All-Space window enumeration","status":"limited","detail":"The general allWindows API is limited to the current Space; broader tracking uses other APIs.","useCase":"Desktop automation and text expansion","platforms":["macOS"],"region":"Operating-system, application and permission requirements apply","evidence":[{"url":"https://www.hammerspoon.org/docs/hs.window.html","locator":"allWindows current-Space limit; window.filter alternative","retrievedAt":"2026-10-07T05:10:44Z","kind":"vendor"}]}],"alternatives":[],"slug":"hammerspoon","draftAlternatives":[{"targetSlug":"keyboard-maestro","status":"limited","detail":"Suitable for macOS shortcut and event automation when Lua authoring is acceptable; macros must be rewritten.","useCase":"Desktop automation","platforms":["macOS"],"region":"Operating-system, application and permission requirements apply","evidence":[{"url":"https://www.hammerspoon.org/","locator":"macOS Lua bridge; events, windows and configuration requirement","retrievedAt":"2026-10-07T05:10:14Z","kind":"vendor"},{"url":"https://wiki.keyboardmaestro.com/manual/Macros","locator":"Triggers, ordered actions, application groups; live saving; recorder edits","retrievedAt":"2026-10-07T05:11:59Z","kind":"vendor"}]}],"evidence":[{"url":"https://www.hammerspoon.org/","locator":"macOS Lua bridge; events, windows and configuration requirement","retrievedAt":"2026-10-07T05:10:14Z","kind":"vendor"}],"document":{"version":1,"references":[{"url":"https://github.com/Hammerspoon/hammerspoon/blob/master/LICENSE","locator":"MIT license","retrievedAt":"2026-10-07T05:10:26Z","id":"hammer-license","title":"Hammerspoon license","kind":"vendor"},{"url":"https://www.hammerspoon.org/","locator":"macOS Lua bridge; events, windows and configuration requirement","retrievedAt":"2026-10-07T05:10:14Z","id":"hammer","title":"Hammerspoon","kind":"vendor"},{"url":"https://www.hammerspoon.org/go/","locator":"Accessibility, Lua configuration, Spoons, variable lifetimes and reload","retrievedAt":"2026-10-07T05:10:26Z","id":"hammer-guide","title":"Hammerspoon getting started","kind":"vendor"},{"url":"https://www.hammerspoon.org/docs/hs.window.html","locator":"allWindows current-Space limit; window.filter alternative","retrievedAt":"2026-10-07T05:10:44Z","id":"hammer-window","title":"Hammerspoon window API","kind":"vendor"},{"url":"https://wiki.keyboardmaestro.com/manual/Macros","locator":"Triggers, ordered actions, application groups; live saving; recorder edits","retrievedAt":"2026-10-07T05:11:59Z","id":"km-macros","title":"Keyboard Maestro macros","kind":"vendor"}],"overviewCitations":["hammer"],"licenseCitations":["hammer-license"],"sections":[{"id":"configuration","heading":"Lua configuration","paragraphs":[{"id":"configuration-detail","content":[{"text":"The main configuration connects triggers to actions, such as a shortcut that rearranges windows or an event handler responding to an application change. The project exposes macOS capabilities through modules rather than one fixed macro format. This favors users comfortable describing behavior in code and consulting an API reference."}],"citations":["hammer"]}]},{"id":"extensions","heading":"Spoons and reusable modules","paragraphs":[{"id":"extensions-detail","content":[{"text":"Prebuilt plugins called Spoons package reusable behavior. The getting-started guide distinguishes installing a Spoon from loading and activating it in the configuration. A downloaded extension therefore is not automatically a complete working setup; its initialization, options and required dependencies remain part of the workflow."}],"citations":["hammer-guide"]}]},{"id":"lifecycle","heading":"Runtime behavior","paragraphs":[{"id":"lifecycle-detail","content":[{"text":"The guide explains that Lua objects such as watchers need retained references or they can be garbage-collected. Reloading configuration destroys the current interpreter and creates another one. These details matter for long-running event automation: a script that creates a watcher once is not enough if its lifetime is not maintained."}],"citations":["hammer-guide"]}]},{"id":"windows","heading":"Window-management scope","paragraphs":[{"id":"windows-detail","content":[{"text":"The window API documents that its general window-listing function sees the current Mission Control Space, with additional qualifications for visible displays, hidden applications and minimized windows. A separate window-filter module addresses broader tracking needs. Multi-Space automation should use the appropriate API instead of assuming that every function returns every window on the Mac."}],"citations":["hammer-window"]}]},{"id":"permissions","heading":"Licensing and access","paragraphs":[{"id":"permissions-detail","content":[{"text":"Hammerspoon is MIT-licensed. Its setup guide calls for Accessibility access to enable relevant desktop-control operations. That permission is a deployment requirement for the intended automation, not proof that a script can manipulate every application without restriction. Older macOS systems may also require a compatible earlier release."}],"citations":["hammer-license","hammer-guide","hammer"]}]},{"id":"substitution","heading":"Substitution considerations","paragraphs":[{"id":"substitution-detail","content":[{"text":"Hammerspoon can substitute for "},{"text":"Keyboard Maestro","targetSlug":"keyboard-maestro"},{"text":" for macOS shortcut-driven window and application automation when Lua-based authoring is acceptable. It offers an API and plugin model rather than direct compatibility with Keyboard Maestro macros. Existing action sequences, triggers and permission requirements must be rebuilt and checked for the specific workflow."}],"citations":["hammer","hammer-guide","km-macros"]}]}]},"id":"Q727","revision":775,"updatedAt":"2026-10-13T05:28:28Z","sourceUrl":"https://substitutefor.net/entities/Q727?revision=775"}}