Skip to content

Hammerspoon 2 0.0.16

Latest

Choose a tag to compare

@cmsj cmsj released this 23 Oct 23:24
· 57 commits to main since this release
f69f9a3

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's hs.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() and hs.eventtap.makeKeyEventWithCode() take an optional array of modifier names (#350)

Changed

  • Hammerspoon 2 now requires macOS 27 or later (#330)
  • hs.osascript async scripts now run in parallel, so their promises resolve in completion order; chain them if you need strict ordering (#330)
  • The hs.ipc broker now exits shortly after hs.ipc stops or Hammerspoon 2 quits, instead of lingering for a minute (#335)
  • HSApplication.title has been renamed to HSApplication.name (#341)
  • HSAXElement.setAttributeValue() and performAction() now throw an Error saying why the Accessibility API refused the change (with the AX error name in err.code), instead of returning false (#349)
  • HSEventTapEvent.flags can now be set, e.g. event.flags = ["cmd", "shift"] (#350)

Fixed

  • A slow or stuck hs.osascript script 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.ipc no 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 an hs.ax element now throws an error naming the expected type (e.g. HSPoint for AXPosition) 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() and app.allWindows now 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