hs.configdir
~/.hammerspoon/
hs.docstrings_json_file
docs.json
file inside Hammerspoon's app bundle. This contains the full Hammerspoon API documentation and can be accessed in the Console using help("someAPI")
. It can also be loaded and processed by the hs.doc
extensionhs.processInfo
hs.accessibilityStateCallback
hs.completionsForInputString(completionWord) -> table of strings
hs.dockIconClickCallback
hs.openConsoleOnDockClick()
hs.fileDroppedToDockIconCallback
hs.urlevent
will be triggered when the following filetypes are dropped onto the Dock Icon: HTML Documents (.html, .htm, .shtml, .jhtml), Plain text documents (.txt, .text), Web site locations (.url), XHTML documents (.xhtml, .xht, .xhtm, .xht).hs.shutdownCallback
hs.textDroppedToDockIconCallback
hs.accessibilityState(shouldPrompt) -> isEnabled
hs.allowAppleScript([state]) -> bool
true
if Hammerspoon's AppleScript commands are (or has just been) allowed, otherwise false
.name
, quit
, version
, etc. However, Hammerspoon will only allow commands from the "Hammerspoon Suite" if hs.allowAppleScript()
is set to true
./Applications/Utilities/Script Editor.app
File > Open Dictionary...
[[
and ]]
rather than normal quoteshs.autoLaunch([state]) -> bool
hs.automaticallyCheckForUpdates([setting]) -> bool
hs.cameraState(shouldPrompt) -> boolean
true
or false
indicating whether or not Camera access is enabled for Hammerspoon.true
on macOS 10.13 or earlier.hs.canCheckForUpdates() -> boolean
hs.checkForUpdates([silent]) -> none
hs.cleanUTF8forConsole(inString) -> outString
hs
command line tool.hs.utf8.fixUTF8(...)
function.hs.closeConsole()
hs.closePreferences()
hs.consoleOnTop([state]) -> bool
hs.coroutineApplicationYield([delay])
delay
- an optional number, default hs.math.minFloat
, specifying the number of seconds from when this function is executed that the coroutine.resume
should be scheduled for.coroutine.yield
, this function does not allow the passing of (new) information to or from the coroutine while it is running; this function is to allow long running tasks to yield time to the Hammerspoon application so other timers and scheduled events can occur without requiring the programmer to add code for an explicit resume.hs.dockIcon([state]) -> bool
hs.dockicon
module, but is provided here to provide an interface consistent with other selectable preference items.hs.execute(command[, with_user_env]) -> output, status, type, rc
os.execute
would return.true
if the command terminated successfully or nil otherwise.with_user_env
to true does incur noticeable overhead, so it should only be used if necessary (to set the path or other environment variables).os.execute
. In most cases, it is probable that stdout
will be the empty string when status
is nil, but this is not guaranteed, so this trade off of shifting os.execute's results was deemed acceptable.os.execute
will be slightly more efficient.hs.execute [["/Some/Path To/An/Executable" "--first-arg" "second-arg"]]
hs.focus()
hs.getObjectMetatable(name) -> table or nil
"hs.screen"
)hs.help(identifier)
"hs.reload"
)help("hs.reload")
help.hs.reload
lua
prefix, rather than hs
.lua._man
provides the table of contents for the Lua 5.3 manual. You can pull up a specific section of the lua manual by including the chapter (and subsection) like this: lua._man._3_4_8
.lua._C
will provide information specifically about the Lua C API for use when developing modules which require external libraries.hs.hsdocs([identifier])
"hs.reload"
). If no string is provided, then the table of contents for the Hammerspoon documentation is displayed.hs.hsdocs.hs.reload
hs.doc.hsdocs
for more information about the available settings for the documentation browser.hs.loadSpoon(name[, global]) -> Spoon object
.spoon
)spoon.NAME
. Defaults to true.:init()
method if it has one. If you do not wish this to happen, or wish to use a Spoon that somehow doesn't fit with the behaviours of this function, you can also simply require('name')
to load the Spoon:start()
method you are responsible for calling it before using the functionality of the Spoon.hs.menuIcon([state]) -> bool
hs.microphoneState(shouldPrompt) -> boolean
true
or false
indicating whether or not Microphone access is enabled for Hammerspoon.true
on macOS 10.13 or earlier.hs.open(filePath)