github Hammerspoon/Hammerspoon2 1.0.0-beta.6
Hammerspoon 2 1.0.0 Beta 6

pre-release52 minutes ago

Added

  • hs.permissions.checkEventPosting() and hs.permissions.requestEventPosting(), for the permission macOS requires before hs.eventtap can send keystrokes and clicks (#556)
  • task.blockUntilExit(timeout), which blocks until a task exits, giving up after timeout seconds if one is given (#539)
  • prefersAssistiveTechnologySettings for hs.speech speakers and speak() options, to speak with VoiceOver's voice and settings when it is running (#558)
  • Named TypeScript types for watcher event names, such as HSPowerEvent and HSWindowFilterEvent, for use in your own types (e.g. Record<HSPowerEvent, () => void>) (#562)
  • The API docs for each on(), off() and once() list the event names it takes, and when each is emitted (#562)
  • hs.application didChangeActivationPolicy event, sent when an app's kind changes (#569)
  • hs.hashing.digest() and hs.hashing.hmac(), which return the raw hash as a Uint8Array (#578)
  • hs.hashing.base32Encode() and hs.hashing.base32Decode() (RFC 4648; decoding ignores case, spaces, - and padding) (#578)
  • hs.window.animationDuration (default 0.2 seconds), so window frame changes are animated as in Hammerspoon 1; set it to 0 to turn animation off (#580)
  • An optional duration argument to win.moveAndResize() (#580)

Changed

  • hs.eventtap now logs a warning in the Console when macOS won't let Hammerspoon 2 send keystrokes or clicks, instead of failing silently (#556)
  • The Console's log re-wraps while the window is being resized, and stays scrolled to the bottom (or keeps its place) as it does (#549)
  • task.waitUntilExit(timeout) now returns a Promise that resolves once the task has exited (or to false after timeout seconds), instead of blocking; use task.blockUntilExit() to block (#539)
  • The API docs no longer list the internal typeName property on types (#559)
  • hs.speech.announce() returns a Promise that resolves to whether VoiceOver accepted the announcement, and no longer takes an interrupt argument
  • hs.application events now cover apps with no Dock icon, including didLaunch and didTerminate (#569)
  • hs.hashing's hash, HMAC and base64Encode functions accept raw bytes (Uint8Array, ArrayBuffer or an array of numbers) as well as strings, and throw for anything else instead of hashing it as a string (#578)

Fixed

  • The Settings window now fits each tab, so every row of the Permissions tab can be seen (#544)
  • Passing null or undefined as the element to hs.ax.on(), hs.ax.once(), hs.ax.off(), hs.ax.findByRole(), hs.ax.findByTitle() or isEqualToElement() crashed Hammerspoon; most of these now throw an error instead (off() logs one, and isEqualToElement() returns false) (#555)
  • The Console no longer uses tens of megabytes of memory (kept after it's closed), or lots of CPU while messages are being logged (#549)
  • hs.speech.announce() is now spoken by VoiceOver while another app is in front. It needs "Allow VoiceOver to be controlled with AppleScript" turned on in VoiceOver Utility
  • hs.window objects no longer report a missing title (and other stale values) for apps like Zoom that replace a window's accessibility element
  • hs.windowfilter no longer loses track of a window when its app replaces the window's accessibility element, as Zoom does when a meeting starts
  • GNU Emacs windows are now found by hs.window, hs.application and hs.windowfilter on macOS 27 (#565)
  • hs.windowfilter tracks the windows of apps with no Dock icon (such as Siri) that start after Hammerspoon 2 (#569)
  • hs.window.allWindows() and related functions no longer stall on, or fill the Console with errors about, background helper processes that have no windows (#575)
  • hs.fs.createPathWatcher() callbacks now include the "ownEvent" flag for changes made by Hammerspoon itself (#579)
  • Setting the frame of a window that can't be resized now moves it, instead of failing (#580)
  • The TypeScript declaration for hs.ui.window's level() now accepts plain level names like "floating"

Full Changelog: 1.0.0-beta.5...1.0.0-beta.6

Don't miss a new Hammerspoon2 release

NewReleases is sending notifications on new releases.