Repository navigation
Added
hs.dockicon.setMenu(), which adds extra items to the menu of Hammerspoon's Dock icon, from an array of menu items or a function called each time the menu opens (#334)hs2 --version, and hs2 now warns at startup if the running Hammerspoon 2 is a different build (#335)require("node:sqlite"), an implementation of Node's synchronous SQLite API (DatabaseSync/StatementSync) using the SQLite that ships with macOS, replacing v1'shs.sqlite3(#339)hs.eventtap.keyStroke(mods, key, app)sends a keystroke with modifiers to a specific application, even in the background, without activating it (#350)hs.eventtap.makeKeyEvent()andhs.eventtap.makeKeyEventWithCode()take an optional array of modifier names (#350)
Changed
- Hammerspoon 2 now requires macOS 27 or later (#330)
hs.osascriptasync scripts now run in parallel, so their promises resolve in completion order; chain them if you need strict ordering (#330)- The
hs.ipcbroker now exits shortly afterhs.ipcstops or Hammerspoon 2 quits, instead of lingering for a minute (#335) HSApplication.titlehas been renamed toHSApplication.name(#341)HSAXElement.setAttributeValue()andperformAction()now throw anErrorsaying why the Accessibility API refused the change (with the AX error name inerr.code), instead of returningfalse(#349)HSEventTapEvent.flagscan now be set, e.g.event.flags = ["cmd", "shift"](#350)
Fixed
- A slow or stuck
hs.osascriptscript no longer delays every other script until it finishes (#330) - HSFont.custom() and HSFont.system(size, weight) are now callable under their documented names (they were customSize() and systemWeight()) (#338)
- hs.ui.webview's evalJSResult() and hs.fs.setTags(), addTags() and removeTags() now appear in the documentation (#338)
- After updating Hammerspoon 2,
hs.ipcno longer keeps talking to the IPC broker from the previous version (#335) JSON.stringify()of geometry objects (HSPoint,HSSize,HSRect),HSColor, screens, windows, applications, audio devices, Bonjour services, MIDI devices and OCR results now includes their values instead of producing{}(#340)setAttributeValue()on anhs.axelement now throws an error naming the expected type (e.g.HSPointforAXPosition) instead of silently returning false when given the wrong kind of value (#342)- hs2 no longer mixes its greeting and connection notices into stdout when input is piped or redirected, so its output can be used directly in scripts (#343)
hs.window.allWindows(),hs.window.windowsForApp()andapp.allWindowsnow include windows in native fullscreen and on other Spaces (see the docs for one limitation) (#351)hs.window.windowsForApp(null)returns an empty array instead of crashing (#351)
Full Changelog: 0.0.15...0.0.16