FAQ

Do you collect information about crashes?

By default, yes. This can be disabled in the Hammerspoon preferences. For more information, see our Privacy Policy

Accessibility issues

Hammerspoon depends on access to the OS X accessibility stack to interact with the desktop, and due to the security requirements in OS X, the user is required to manually allow Hammerspoon access to the accessibility features. OS X manages the list of applications with access to accessibility features in System Preferences. Click on the `Security & Privacy` icon, then the `Privacy` tab and then `Accessibility` from the list. You should ensure that Hammerspoon is present in this list and is ticked.

I can't add Hammerspoon to the list, or enable it

It is unlikely, but possible, that the database controlling access to accessibility features, has become de-syncronised from reality. There is a guide to how to recover from this situation, at http://mizage.clarify-it.com/d/6ervmn (replace 'divvy' in the SQL query, with 'hammerspoon') It's also possible that your Launch Services database has become confused/corrupt. You can force it to rebuild with the command:
sudo /System/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user

hs.application issues

Application names aren't what I expect

If you are trying to find Microsoft Office applications (e.g. using hs.appfinder.appFromName("Word")), they present a different application name to the OS than they display in the system menu bar. Use "Microsoft Word", "Microsoft Excel", etc. instead.

You can get a list of the real names of all running applications in the Hammerspoon Console with the following snippet:

hs.fnutils.each(hs.application.runningApplications(), function(app) print(app:title()) end)

I can't make :findMenuItem() or :selectMenuItem() work in the Hammerspoon Console

Many OS X applications (e.g. Emacs, IBM Notes, Adium) mark their menus as disabled when their windows lose focus, so you may find that you can't play with them from the Hammerspoon Console. Your only option here is to encode the actions in your init.lua or bind them to events (such as hotkeys) from the console, then transfer focus back to the application window.