advance(seconds) |
Moves the clock, firing timers and settling promises between them |
flush() |
Settles pending promises |
addApp({ bundleID, name, allWindows, focusedWindow, mainWindow }) |
Adds a running app and returns it |
activate(bundleID) |
Brings an app to the front and emits didActivate; null for one without a bundle ID |
killed, launched, activations, raised |
Apps killed, launched and activated, and windows raised |
frontmostRequests |
Times Hammerspoon asked to be frontmost |
element({ role, children, attributes }) |
An accessibility element |
window(element) |
A window whose element it is |
url(text) |
A URL attribute value, as hs.ax returns it |
hotkeys |
Created hotkeys that have not been destroyed |
tasks |
Started tasks: launchPath, args, environment, running, terminated, inputClosed, finish({ stdout, exitCode, reason, error }) |
respondToTasks(handler) |
Answers each task as it starts with what finish() takes, or undefined to leave it running |
menubarItems |
Menu bar items: item, icon, menu, destroyed |
notifications |
title, body; click() for show() ones, options for create() ones |
dialogs |
message, informativeText, buttons, open, press(label) |
windows |
rect, title, view.html, view.post(name, body), shown, userClose() |
alerts, openedURLs |
What was shown and opened |
files, dirs, home, writeFails |
The in-memory file system |
power(event), notify(name) |
Emits an hs.power event or a distributed notification |
ssid, wifi(event) |
The current Wi-Fi network, and its events |
addAudioDevice({ name, uid, input }) |
Adds an audio device (emits dev+) and returns it |
removeAudioDevice(device) |
Removes it (emits dev-) |
setDefaultAudioDevice(direction, device) |
Sets the default and emits dOut or dIn |
updateAudioDevice(device, changes) |
Sets volume or muted and emits the device event |
audioListeners() |
Number of audio listeners registered |
images |
Add the names HSImage.fromName can load |
accessibility, location, notificationPermission |
Whether each permission is granted |
locationRequests |
How often location permission was requested |