Hammerspoon Changelog

What's new in Hammerspoon 0.9.100

Mar 15, 2023
  • Added:
  • hs.hash now has binary-preserving variants of MD5/SHA1/SHA256/SHA512 (where the existing functions encode the hash to a hex string). These functions have been added to support the new OBS Spoon

New in Hammerspoon 0.9.99 (Mar 14, 2023)

  • Fixed:
  • Revert SocketRocket pod update. Closes #3422 #3424
  • Fix hs.application.get() interpreting Lua patterns #3425
  • Added:
  • hs.application.find() now has two additional parameters for controlling how the hint string is interpreted

New in Hammerspoon 0.9.98 (Mar 13, 2023)

  • Fixed:
  • hs.image:colorAt() now takes into account scale #3185
  • Fixed crash in hs.image.getExifFromPath() #3177
  • Fix hs.spaces so it works when hs.spaces.screensHaveSeparateSpaces() is false #3196
  • Fix two crash bugs in hs.camera #3211
  • add DemoPro to SKIP_APPS_TRANSIENT_WINDOWS #3236
  • Fix bug where window switcher does not go away when caps lock is on #3238
  • Fix hs.application.get() always returning nil #3216
  • Fix lua-objc mapping to handle high/low surrogate pairs in hs.styledtext #3356
  • Spaces now finds Dock instead of Docker #3371
  • Truncate Console scrollback history #3400
  • Fix windowHints bugs with utf8 chars #3243
  • Fix ICMP socket leak in hs.ping #3419
  • Changed:
  • Allow hs.chooser query to still be forwarded when no matching string exists #3232
  • Bump minimum requirements to macOS 11.0 #3312
  • Speed up window switching timers #3237
  • Added:
  • Added ability to save a hs.menubar position between reloads #3195
  • Added functions to get application localization information #3191
  • hs.http must follow redirects #1889 #3279
  • Added hs.mouse.currentCursorType() #3265
  • Added hs.serial:rts() and hs.serial:dtr() #3314
  • feat(spaces): add force arg for moveWindowToSpace #3298
  • hs.fnutils.reduce takes an optional initial value #3363
  • Added support for Stream Deck Mini V2 #3378
  • Added support for Stream Deck Plus #3383
  • Add hs.streamdeck:imageSize() #3407
  • Add support for Stream Deck Pedal #3409

New in Hammerspoon 0.9.97 (Mar 30, 2022)

  • Extensions:
  • Fixed: hs.menubar no longer overlaps images and text, if both are set. Fixes #3171
  • Fixed: hs.spaces no longer errors if Docker.app is installed. Fixes #3170
  • Added: hs.menubar:imagePosition()

New in Hammerspoon 0.9.96 (Mar 29, 2022)

  • Core:
  • Lua search paths (package.path and package.cpath) have been updated to search in some additional locations
  • Extensions:
  • Fixed: hs.http connection callbacks should no longer crash in some situations if Lua coroutines are being used.
  • Fixed: Prevented a possible race condition in hs.webview when fading and deleting an object
  • Added: hs.webview.toolbar:toolbarStyle()
  • Added: hs.screen:getInfo() (may be helpful for distinguishing between multiple identical monitors)
  • Added: Various functions in hs.spaces
  • Changed: Several macOS SDK deprecations have been adapted to, across multiple modules. Please report any regressions found.

New in Hammerspoon 0.9.95 (Mar 13, 2022)

  • Extensions:
  • Fixed: hs.camera.isInUse() no longer crashes

New in Hammerspoon 0.9.94 (Feb 25, 2022)

  • Core:
  • Default values of package.path/package.cpath should now work with Homebrew luarocks on Apple Silicon
  • Extensions:
  • Added: hs.razer to support Razer Tartarus V2
  • Added: hs.image.toASCII()
  • Added: hs.http.put(), hs.http.asyncPut()
  • Added: hs.streamdeck now supports the Mk2 model
  • Added: hs.urlevent.mailtoCallback for handling mailto: URIs
  • Fixed: hs.audiodevice:setBalance() now works correctly
  • Fixed: hs.doc.builder can now be loaded again
  • Fixed: hs.camera.isInUse() now works correctly
  • Fixed: hs.serial.deviceCallback() should no longer crash in some circumstances
  • Fixed: hs.mouse should now correctly determine if a pointing device is internal
  • Fixed: hs.streamdeck now correctly reads serial/firmware information on all models
  • Changed: hs.processInfo now contains information about CPU architecture and use of Rosetta2
  • Changed: Attempted to work around a crash in hs.eventtap
  • Changed: hs.ipc callbacks now limit how many times they can be called recursively, to work around a potential crash
  • Changed: hs.keycodes now attempts to work around a change in macOS 12 that caused keycodes 93 and 94 to be listed incorrectly

New in Hammerspoon 0.9.93 (Dec 13, 2021)

  • Extensions:
  • Fixed: hs.docs.hsdocs and hs.docs.markdown now work, allowing the “Help” button in the Console window to function

New in Hammerspoon 0.9.92 (Dec 13, 2021)

  • Core:
  • Significant rearrangement of the Hammerspoon.app bundle. This should be transparent to users, but there may be some modules that are broken. Please open Issues on GitHub if this affects you.
  • Extensions:
  • Added: hs.shortcuts and a Shortcuts action for executing Lua in Hammerspoon
  • Added: hs.audiodevice:inUse() to identify if an audio device (input or output) is currently being used
  • Added: hs.camera for enumerating/watching camera devices, and checking the “in use” status
  • Fixed: hs.httpserver should now be able to process text WebSocket messages properly
  • Fixed: hs.http should no longer crash when its callbacks are called from a Lua corouting
  • Fixed: hs.expose should now handle screen layouts better
  • Changed: hs.canvas should now handle Lua garbage collection better

New in Hammerspoon 0.9.91 (Oct 27, 2021)

  • Core:
  • Various updates for macOS 12 Monterey
  • Extensions:
  • Added: hs.serial.availablePortDetails()
  • Fixed: hs.chooser subText field now truncates correctly
  • Fixed: hs.vox now handles VOX not running
  • Fixed: hs.loadSpoon() will no longer cause a stack overflow crash if passed an empty Spoon name

New in Hammerspoon 0.9.90 (May 9, 2021)

  • Extensions:
  • Fixed: A previous crash fix in hs.hotkey was not effective, it should now be. If you experience crashes with this version of Hammerspoon, please report them on GitHub.

New in Hammerspoon 0.9.89 (May 3, 2021)

  • Extensions:
  • Fixed: Potential crashes in hs.uielement.watcher, hs.audiodevice.watcher and hs.keycodes are now guarded against

New in Hammerspoon 0.9.88 (Apr 27, 2021)

  • Fixed:
  • A potential crash in hs.screenRecordingState() was fixed #2819
  • hs.json functions now work when called from a Lua coroutine #2830
  • hs.location.geocoder.lookupAddress() should no longer crash in some circumstances. #2846
  • Changed:
  • hs.urlevent callback now receives the sender's PID where possible #2832
  • If hs.loadSpoon() is called twice for the same Spoon, the second call will now return the first spoon object instead of reloading it #2837
  • Included version of Lua is now 5.4.3 #2844
  • Added:
  • hs.alert.showWithImage() #2799
  • Other:
  • Alternate method for nil app obj detection in hs.window #2790

New in Hammerspoon 0.9.87 (Apr 11, 2021)

  • Core:
  • The additional compiler protections from 0.9.86 have been disabled. This version should therefore be safe to upgrade to, if you use the hs command line tool.
  • The website documentation now contains links to the source code of each function/method/etc.
  • Extensions:
  • Fixed: hs.json no longer returns a string instead of a table in some situations
  • Fixed: hs.webview:evaluateJavaScript() callbacks can no longer sometimes run on a background thread (which would crash Hammerspoon)
  • Fixed: hs.task should no longer crash Hammerspoon when a SIGPIPE is raised
  • Added: hs.audiodevice.defaultEffectDevice() and hs.audiodevice:setDefaultEffectDevice()

New in Hammerspoon 0.9.86 (Mar 15, 2021)

  • Core:
  • Additional runtime compiler protections have been enabled to try and solve some crashes. Please consider filing GitHub issues if you run into any crashes.
  • Extensions:
  • Fixed: hs.itunes now correctly sends commands to Music.app on macOS 11.x
  • Fixed: A potential crash in hs.serial has been fixed
  • Fixed: A potential crash in hs.eventtap callbacks has been fixed
  • Changed: hs.websocket:send() now has an optional parameter to switch from sending binary data to sending strings.

New in Hammerspoon 0.9.85 (Mar 12, 2021)

  • Core:
  • Additional runtime compiler protections have been enabled to try and solve some crashes. Please consider filing GitHub issues if you run into any crashes.
  • Extensions:
  • Fixed: Various bugs found via static analysis
  • Fixed: hs.window:snapshot() transparency argument is now honoured
  • Fixed: hs.hotkey.bind() documentation now correctly describes the message argument
  • Fixed: A crash in hs.settings has been fixed
  • Fixed: A potential crash in hs.chooser has been guarded against
  • Fixed: Several potential crashes in hs.canvas have been guarded against
  • Fixed: A potential crash in hs.fs.volume watchers has been guarded against
  • Changed: hs.window.desktop() now returns nil if Finder isn’t running
  • Changed: If the Hammerspoon install is damaged, the user will now be notified
  • Changed: hs.window:isVisible() will now return false if the underlying hs.application object is invalid

New in Hammerspoon 0.9.84 (Mar 5, 2021)

  • Extensions:
  • Fixed: hs.application:isFrontmost() works again

New in Hammerspoon 0.9.83 (Mar 4, 2021)

  • Core:
  • Included Lua version is now 5.4.2
  • App icon updated to the new Big Sur style
  • Extensions:
  • Added: hs command line tool now has an option to abort if Hammerspoon isn’t running
  • Added: hs.plist now supports binary data
  • Added: hs.plist.readString() and .writeString()
  • Added: hs.screen:mirrorOf() and :mirrorStop() to allow control of screen mirroring
  • Added: hs.dockicon.tileCanvas() for showing hs.canvas objects in the Hammerspoon dock icon
  • Added: hs.eventtap.event:getTouches()
  • Fixed: Various fixes in hs.window.filter
  • Fixed: hs.screen:name() now works on Apple Silicon
  • Fixed: hs.brightness now works on Apple Silicon
  • Fixed: Calling hs.json.encode() with no arguments no longer crashes Hammerspoon
  • Fixed: hs.notify should no longer leak memory for every notification
  • Fixed: Various fixes in hs.window.highlight
  • Changed: hs.screen:setMode() now requires more arguments
  • Changed: hs.screen:currentMode() and :availableModes() now report colour depth
  • Changed: minor visual improvements to hs.chooser
  • Changed: hs.eventtap.keyStroke() and .keyStrokes() can now send the strokes to a specific application

New in Hammerspoon 0.9.82 (Nov 18, 2020)

  • Core:
  • Minimum supported macOS version is now 10.13
  • Universal build for native support on Apple Silicon
  • Extensions:
  • Added: hs.image.getExitFromPath()
  • Added: hs.sound.getAudioEffectName()
  • Changed: Improved hs.alert padding

New in Hammerspoon 0.9.81 (Sep 29, 2020)

  • Core:
  • MJConfigDir is now more resilient against symlinks
  • Extensions:
  • Changed: hs.fs is now updated to LuaFileSystem 1.8.0
  • Fixed: hs.window moveScreen methods are now available again
  • Fixed: hs.eventtap.event:post() regression
  • Fixed: hs.windowfilter is now less likely to produce error messages
  • Fixed: hs.window tab methods now work with Safari 14

New in Hammerspoon 0.9.80 (Sep 21, 2020)

  • Extensions:
  • Fixed: hs.window.filter should no longer cause errors from hs.uielement objects

New in Hammerspoon 0.9.79 (Sep 21, 2020)

  • Core:
  • Updated Lua to 5.4.0
  • Hammerspoon now works with Lua coroutines
  • Switched from Crashlytics to Sentry.io for crash reporting
  • Extensions:
  • Added: hs.axuielement
  • Added: hs.serial
  • Added: hs.websocket
  • Added: hs.application:setFrontmost()
  • Added: hs.screenRecordingState()
  • Added: hs.window.list()
  • Added: hs.pasteboard.watcher()
  • Added: hs.relaunch()
  • Added: hs.coroutineApplicationYield()
  • Added: hs.math.isNan(), hs.math.isFinite() and hs.math.isInfinite()
  • Added: hs.chooser:invalidCallback()
  • Added: hs.fs.urlFromPath()
  • Added: hs.canvas.useCustomAccessibilitySubrole()
  • Changed: hs.http.websocket is now hs.websocket
  • Changed: hs.streamdeck now supports XL and Mini decks
  • Changed: MJConfigFile preference option now resolves symlinks
  • Fixed: Potential memory leak in hs.eventtap.event:getUnicodeString()
  • Fixed: hs.chooser now shows icons correctly
  • Fixed: Potential crashes in various modules
  • Fixed: hs.socket.udp() can now send binary data
  • Fixed: delay in hs.webview.toolbar

New in Hammerspoon 0.9.78 (Jan 14, 2020)

  • Extensions:
  • Fixed: hs.chooser no longer incorrectly applies transparency to row icons
  • Fixed: hs.eventtap.event:getUnicodeString() no longer leaks a small amount of RAM for each call
  • Added: hs.relaunch()
  • Added: hs.streamdeck now supports the Mini and XL variants of the hardware
  • Changed: hs.urlevent can now also be the default system handler for mailto: URIs

New in Hammerspoon 0.9.77 (Jan 14, 2020)

  • Core:
  • Hammerspoon’s Lua environments now pass in a high quality random number to math.randomseed() so it is no longer to manually call that function in your Lua configs
  • For new users, Hammerspoon now defaults to running without a dock icon
  • Extensions:
  • Fixed: hs.itunes extension now correctly talks to macOS 10.15’s Music.app
  • Fixed: various bugs in hs.uielement
  • Added: hs.screen:setOrigin()
  • Added: hs.math with a couple of random number generation functions
  • Added: hs.window.timeout()
  • Added: hs.plist.readString()
  • Changed: hs.image.imageFromURL() now supports asynchronous operation via a callback

New in Hammerspoon 0.9.76 (Oct 9, 2019)

  • CORE:
  • The minimum supported version of macOS is now 10.12.
  • Hammerspoon is now Notarized to satisfy macOS Catalina requirements. Please report any issues you run into.
  • EXTENSIONS:
  • Removed: hs.drawing has been removed. Its API remains available via an emulation layer built on hs.canvas
  • Fixed: A potential crash in js.json is now guarded against
  • Fixed: A potential crash in hs.application:getMenus() is now guarded against
  • Fixed: hs.http POST calls now work better with raw binary data
  • Added: hs.hid.led
  • Added: hs.bonjour
  • Added: hs.window:isMaximizable()
  • Added: hs.eventtap.event:getUnicodeString()/setUnicodeString()
  • Added: hs.screen:getUUID()
  • Added: hs.fs.pathToBookmark()
  • Added: hs.webview.toolbar.uniqueName()
  • Added: hs.webview:isVisible()
  • Added: hs.mouse.count() and hs.mouse.names()
  • Added: hs.host.locale.localizedString()
  • Added: hs.microphoneState() and hs.cameraState()
  • Added: hs.json.read() and hs.json.write()
  • Changed: hs.chooser’s UI has been updated and should now correctly return input focus to the previous app when it is dismissed
  • Changed: hs.caffeinate.lockScreen() has been replaced with a new implementation that works more correctly. The old implementation is now available as hs.caffeinate.fastUserSwitch()
  • Changed: hs.screen.find() can now search for screens by UUID
  • Changed: hs.fs.getPathFromBookmark() is now hs.fs.pathFromBookmark()
  • Changed: hs.eventtap.event.newMouseEvent() now accepts mouseMoved events
  • Changed: hs.updateAvailable() now also returns the build number of an available version

New in Hammerspoon 0.9.75 (Jul 11, 2019)

  • Core:
  • None
  • Extensions:
  • Fixed: 0.9.73 included a regression in hs.grid. This is now fixed.

New in Hammerspoon 0.9.74 (May 3, 2019)

  • Core:
  • Fixed some bugs, mostly in the API docs
  • Extensions:
  • Added: hs.audiodevice:balance() and hs.audiodevice:setBalance()
  • Added: hs.fs.getPathFromBookmark()
  • Added: hs.screen.setForceToGray(), .getForceToGray(), .getInvertedPolarity() and .setInvertedPolarity()
  • Added: hs.spotify.getCurrentTrackId() and .playTrack()
  • Added: hs.battery.psuSerialString()
  • Added: hs.application.defaultAppForUTI()
  • Changed: hs.chooser query field can now have placeholder text
  • Changed: hs.location.sunrise() and .sunset() are now much more reliable
  • Changed: hs.dialog.text now supports secure entry (ie password fields)
  • Changed: hs.styledtext.loadFont() should now be more reliable
  • Changed: hs.hints icon alpha value is now configurable

New in Hammerspoon 0.9.73 (Oct 25, 2018)

  • Extensions:
  • Fixed: macOS 10.14 (mojave) should now correctly ask for permission to send AppleScript events to other applications
  • Added: Add hs.eventtap.isSecureInputEnabled()

New in Hammerspoon 0.9.72 (Oct 25, 2018)

  • Extensions:
  • Fixed: Reverted change from 0.9.71 for hs.chooser because it broke keyboard selection in Chooser widgets

New in Hammerspoon 0.9.71 (Oct 25, 2018)

  • Extensions:
  • Added: hs.location.dstOffset()
  • Added: hs.styledtext.fontPath()
  • Added: hs.menubar menus can now be forced to use dark mode
  • Fixed: hs.socket no longer locks up when reading/writing a lot of data from/to a socket
  • Fixed: hs.webview no longer crashes when certain callbacks happen on a background thread
  • Fixed: Memory leaks in hs.canvas and hs.image
  • Fixed: Fixed a bug in hs.audiodevice.watcher where callbacks were not being freed
  • Fixed: hs.window.switcher no longer shows an empty rectangle if showSelectedThumbnail is set to false
  • Changed: hs.chooser now takes account of the query string in refreshChoicesCallback()
  • Removed: hs.tangent.interval

New in Hammerspoon 0.9.70 (Jul 17, 2018)

  • Extensions:
  • Fixed: Cursor selection in hs.chooser was broken in a previous release. It now works correctly.

New in Hammerspoon 0.9.69 (Jul 13, 2018)

  • 0.9.67 was a decent sized release, but since we’ve had to immediately do two brownbag releases to fix crash bugs, you might not see the release notes for 0.9.67. They’re worth reading, so you can find them here
  • Extensions:
  • Fixed: revert another memory leak fix which can also cause crashes

New in Hammerspoon 0.9.66 (Apr 29, 2018)

  • Extensions:
  • Fixed: hs.menubar no longer crashes if a menu item triggers a refresh of the menu data

New in Hammerspoon 0.9.65 (Apr 29, 2018)

  • Core:
  • Code paths from Hammerspoon into Lua code should be generally more reliable now
  • Extra protection was added to all extensions that use callbacks. This may trigger more crashes in the short term, but allows us to fix the issues more easily.
  • Console window tab completion no longer leaks a Lua stack slot
  • Extensions:
  • Fixed: hs.location callbacks should now receive the correct arguments as documented
  • Fixed: hs.notify no longer leaks a Lua stack slot in some circumstances

New in Hammerspoon 0.9.64 (Apr 5, 2018)

  • Core:
  • Our Lua bridge now pays more attention to memory management of the Lua stack, which should improve stability.
  • Extensions:
  • Changed: hs.processInfo now uses more robust memory management, and also now includes buildTime and debugBuild keys
  • Changed: hs.menubar:setClickCallback() now unconditionally removes existing callback handlers, fixing a potential leak
  • Fixed: hs.http should now manage memory more correctly

New in Hammerspoon 0.9.63 (Apr 5, 2018)

  • Core:
  • We should behave more correctly now when pushing large numbers of items into Lua, which should reduce crashes
  • Extensions:
  • Changed: hs.streamdeck is now more explicit to the compiler as to how its memory is managed

New in Hammerspoon 0.9.62 (Apr 5, 2018)

  • Extensions:
  • Fixed: 0.9.61 broke several hs.window methods. These have now been fixed.

New in Hammerspoon 0.9.61 (Apr 5, 2018)

  • Core:
  • Changed: Lua’s internal API checker is now enabled. This may well cause more crashes than before, but if you report them to us, we can fix them and Hammerspoon will be more reliable!
  • Changed: The main Hammerspoon preferences window is no longer opened every time the user runs a new version of Hammerspoon.
  • Extensions:
  • Changed: hs.midi’s underlying MIDI library has been updated.
  • Changed: hs.alert now supports fading in and out
  • Changed: hs.osascript.appleScriptFromFile() and hs.osascript.javascriptFromFile() now ignore shebang lines at the start of script files
  • Changed: hs.keycodes should now only list selectable layouts and input methods
  • Changed: hs.tangent now correctly handles multiple commands arriving concurrently from a tangent device
  • Fixed: hs.streamdeck’s discovery callback is now correctly invoked when a streamdeck device is disconnected

New in Hammerspoon 0.9.60 (Feb 11, 2018)

  • IMPORTANT:
  • We are currently focusing very hard on a small set of very strange crashes in Hammerspoon. If Hammerspoon crashes for you, please reach out to us via GitHub, or IRC, or email and send us your config. We have not yet been able to reproduce the crashes, and are very keen to do so!
  • Core:
  • Changed: Crash message logging has now been fixed
  • Fixed: Console window should now format dates consistently regardless of user locale
  • Fixed: Console window reload toolbar icon now scales properly
  • Fixed: Various issues found by code analysis and memory analysis (including at least two crasher bugs)
  • Extensions:
  • Added: hs.hid.capslock
  • Added: hs.tangent

New in Hammerspoon 0.9.59 (Jan 23, 2018)

  • IMPORTANT:
  • We are currently focusing very hard on a small set of very strange crashes in Hammerspoon. If Hammerspoon crashes for you, please reach out to us via GitHub, or IRC, or email and send us your config. We have not yet been able to reproduce the crashes, and are very keen to do so!
  • Core:
  • Changed: Crash message logging has now been fixed
  • Extensions:
  • Changed: hs.socket can now be used for binary protocols

New in Hammerspoon 0.9.58 (Dec 29, 2017)

  • Extensions
  • Added: hs.midi
  • Added: Hammerspoon’s Console window now has a default toolbar with some useful functions (see hs.console.toolbar for customisation options)
  • Added: hs.styledtext now supports allowsTighteningForTruncation on macOS 10.11+
  • Added: hs.battery.privateBluetoothBatteryInfo() (for getting information from AirPods).
  • Added: hs.window.minimizedWindows() and hs.window.invisibleWindows()
  • Added: hs.osascript.applescriptFromFile() and hs.osascript.javascriptFromFile()
  • Fixed: hs.host.cpuUsage now uses the correct default period if a nil period was supplied in addition to a callback.
  • Fixed: Calling hs.reload() from the hs command line tool no longer crashes.
  • Changed: hs.window.layout now has a noaction command and a frontmost selector
  • Changed: hs.window.filter now has a hasTitlebar filter
  • Changed: hs.alert now supports atScreenEdge style parameter
  • Changed: Various improvements to hs.dialog
  • Changed: hs.chooser:show() now accepts an optional set of co-ordinates for the window position.
  • Changed: hs.fs.volume.eject() now returns a string in addition to a boolean, which may contain useful error information.
  • Changed: hs.window.switcher now displays on the same screen as the currently focused window

New in Hammerspoon 0.9.57 (Oct 17, 2017)

  • Extensions:
  • Fixed: hs.battery.getAll() improved handling non-functions
  • Fixed: hs.eventtap.event.newKeyEvent() restores pre-0.9.56 behaviour with nil modifiers parameters
  • Fixed: hs.caffeinate.startScreensaver() now works under High Sierra
  • Fixed: hs.streamdeck no longer incorrectly garbage collects button callbacks

New in Hammerspoon 0.9.56 (Sep 17, 2017)

  • Core:
  • Fixed: Lua copyright dates are now correct
  • Extensions:
  • Fixed: hs.base64.encode() should no longer crash when fed invalid input
  • Fixed: hs.eventtap middle/other mouse button event synthesis should now work again
  • Added: hs.streamdeck
  • Added: hs.dialog
  • Added: hs.fs.xattr
  • Added: hs.eventtap.event:timestamp()
  • Added: hs.timer.absoluteTime()
  • Added: hs.hotkey.assignable() and hs.hotkey.systemAssigned()
  • Added: hs.window:focusTab()
  • Added: hs.fs.displayName()
  • Added: dark mode support to hs.webview, Preferences window and Console window
  • Added: hs.host.gpuVRAM()
  • Added: hs.battery.otherBatteryInfo() (provides battery charge level for compatible Bluetooth devices)
  • Added: hs.mouse.scrollDirection()
  • Added: hs.settings.watchKey()
  • Added: hs.urlevent.openURL()
  • Changed: hs.ipc has been completely rewritten
  • Changed: hs.grid no longer places double-width margins between windows
  • Changed: hs.plist can now handle paths with ~ in them
  • Changed: hs.network.configuration:setLocation() can now accept UUIDs as well as names
  • Changed: hs.notify.warnAboutMissingFunctionTag can now be a function
  • Changed: The window entry in hs.layout tables can now also be a window object, or a function that returns a list of window objects

New in Hammerspoon 0.9.55 (Jul 18, 2017)

  • Extensions:
  • Fixed: hs.spotify play/pause states should now be reported correctly
  • Fixed: hs.http no longer assumes that HTTP responses can be encoded as UTF8 (e.g. if they are binary responses)
  • Fixed: hs.eventtap.event properties now agree with the documentation about the name of “other” mouse buttons
  • Added: hs.image:encodeAsURLString()
  • Added: hs.webview.toolbar:selectSearchField()
  • Added: Drag&drop support in hs.canvas
  • Added: hs.console can now fully theme the Hammerspoon Console
  • Added: hs.host.idleTime, hs.host.thermalState
  • Added: hs.pathwatcher callback now receives event information
  • Added: hs.spoons
  • Added: hs.open() for quickly opening files (URL support to come later)
  • Added: hs.plist
  • Changed: Some improvements to hs.webview
  • Changed: hs.image exporting functions can now control pixel size
  • Changed: hs.layout.apply() should make windows jump around less
  • Changed: hs.chooser now ignores the special meanings of Option-Enter and Ctrl-Enter, allowing them to be used for alternate selection operations

New in Hammerspoon 0.9.54 (Apr 27, 2017)

  • Extensions:
  • Fixed: Fixed a regression in hs.keycodes which prevented binding hotkeys to the § key on ISO keyboards
  • Added: hs.hotkey.bindSpec()

New in Hammerspoon 0.9.53 (Apr 25, 2017)

  • Core:
  • Addeed support for pure-Lua plugins, or Spoons, see http://www.hammerspoon.org/Spoons/
  • The bundled Lua is now 5.3.4
  • Exceptions generated inside Hammerspoon as part of Lua callbacks are no longer fatal and will print a traceback to the Console window
  • Crash report uploading behaviour can now be controlled via hs.uploadCrashData()
  • Hammerspoon now exposes a minimal AppleScript API for executing Lua code from AppleScript
  • The console window will now save/restore its window location
  • Extensions:
  • Fixed: Guarded against a potential crash in hs.application:getMenuStructure()
  • Fixed: hs.application.find() no longer fails if applications have no :name() value
  • Fixed: hs.checkForUpdates() can now optionally check for Hammerspoon updates without presenting any UI if an update is found
  • Fixed: Removed a small memory leak in hs.menubar when removing menu items
  • Fixed: hs.host.cpuUsage now properly samples CPU ticks
  • Fixed: hs.chooser will now scroll to values selected via hs.chooser:selectedRow()
  • Fixed: hs.timer objects can now work more successfully with sub-second precision
  • Fixed: hs.application:path() now correctly distinguishes between multiple installed copies of the same application
  • Changed: hs.keycodes.map now includes modifier keycodes, JIS keycodes, and will fallback to ANSI US keyboard values
  • Changed: hs.canvas elements with an alphanumeric id attribute can now be accessed directly from the canvas object, using that id.
  • Changed: hs.menubar callbacks registered with :setClickCallback() now receive a reference to the menubar item when called
  • Changed: hs.itunes.previous() now mirrors the behaviour of the equivalent keyboard key, rather than unconditionally skipping back a track
  • Changed: hs.layout items can now specify callback functions for unit/frame/full-frame values
  • Changed: hs.pasteboard:writeDataForUTI()/:writeArchiverDataForUTI()/writePListForUTI() can now be used to write data to the pasteboard for multiple UTIs
  • Changed: hs.color objects can now be created from HTML hex colour strings
  • Changed: hs.noises now uses its own processing queue, which should make Hammerspoon more responsive when this module is being used
  • Changed: hs.httpserver, hs.doc.hsdocs and hs.httpserver.hsminweb can now be configured to listen on a specific network interface
  • Changed: hs.keycode.map.kVK_ANSI_Quote now contains the correct value
  • Changed: hs.ipc.cliUninstall() will now unconditionally remove the CLI tools it finds on disk
  • Added: hs.sqlite3
  • Added: hs.audiodevice:inputMuted(), hs.audiodevice:outputMuted(), hs.audiodevice:setInputMuted(), hs.audiodevice:setOutputMuted()]
  • Added: hs.itunes, hs.spotify and hs.deezer now have .getDuration()
  • Added: hs.updateAvailable()
  • Added: hs.chooser lists can now be scrolled with Ctrl-P/N/V
  • Added: hs.vox (equivalent to hs.itunes/hs.spotify/hs.deezer for the Vox music player)
  • Added: hs.chooser:showCallback(), hs.chooser:select(), hs.chooser:cancel()
  • Added: hs.pasteboard.readAllData(), hs.pasteboard.writeAllData()
  • Added: hs.accessibilityStateCallback
  • Added: hs.webview:windowCallback()
  • Added: hs.images.systemImageNames now includes new system images from macOS 10.12 (when running on 10.12 or higher)
  • Added: hs.application.infoForBundleID() and hs.application.infoForBundlePath()
  • Added: hs.host.locale
  • Added: hs.textDroppedToDockIconCallback() and hs.fileDroppedToDockIconCallback() for receiving text/files via drag and drop onto the Hammerspoon dock icon (also available via the macOS Services menu)
  • Added: hs.eventtap.event:getFlags() values now support :contains() and :containExactly() to assist checking which flags are set

New in Hammerspoon 0.9.52 (Dec 31, 2016)

  • Core:
  • Non-interactive output lines in the Console Window now have timestamps
  • Extensions:
  • Fixed: Fixed an infinite loop regression in hs.chooser
  • Changed: hs.chooser now defaults to the light/dark theme setting of macOS

New in Hammerspoon 0.9.51 (Dec 27, 2016)

  • Core:
  • Objective C exceptions that happen inside Lua callbacks should no longer cause Hammerspoon to exit.
  • Fixed a potential crash in the About window (seriously)
  • The rebuild.sh script documented in CONTRIBUTING.md, for doing self-signed local builds of Hammerspoon, is now included in the scripts/ directory
  • Extensions:
  • Fixed: Fixed a potential crash in hs.application.getMenuStructure()
  • Fixed: Fixed a potential crash in hs.styledtext
  • Fixed: Fixed a potential crash in hs.keycodes
  • Fixed: Fixed a potential crash in hs.webview
  • Fixed: hs.drawing should be more resistant against crashing when given impossible sizeRect arguments
  • Fixed: hs.chooser should be more resistant against crashing when receiving unusual events
  • Fixed: hs.chooser should no longer crash when no rows are displayed, but a selection event occurs
  • Fixed: hs.chooser should no longer leak Lua function references
  • Fixed: hs.application.getMenuStructure() now correctly reports the enabled state of menu items
  • Fixed: Fixed a crash in hs.audiodevice watchers that only occurred with certain third party audio hardware
  • Changed: hs.eventtap functions now have a configurable delay between sending events
  • Changed: hs.chooser now looks better when a choice has no subText
  • Changed: hs.chooser:selectedRow() can now be use to manually select a row
  • Changed: hs.chooser now logs Lua callback exceptions to the Hammerspoon Console
  • Changed: hs.chooser right click callbacks now receive an argument containing the row that was clicked on
  • Changed: hs.chooser will now update its search results if you use the API to change the search query or choices)
  • Changed: hs.wifi has been modernised to newer macOS APIs and now allows watchers to know when many more wireless properties change (e.g. roaming between BSSIDs, link quality changes, etc.
  • Added: hs.spotlight
  • Added: hs.network.ping
  • Added: hs.deezer
  • Added: hs.watchable
  • Added: hs.canvas
  • Added: hs.caffeinate.sessionProperties()
  • Added: hs.alert style can now specify the corner radius
  • Added: hs.webview windows can now have shadows
  • Added: hs.chooser:selectedRowContents()
  • Added: hs.screen.accessibilitySettings()

New in Hammerspoon 0.9.50 (Nov 18, 2016)

  • Extensions:
  • Fixed: Several hs.timer regressions introduced in 0.9.47 have been fixed.

New in Hammerspoon 0.9.49 (Nov 17, 2016)

  • Extensions:
  • Fixed: Various crashes have either been fixed or guarded against
  • Fixed: hs.screen now correctly cleans up after itself when reloading the config
  • Fixec: hs.pasteboard is now less likely to lose track of an item when the system pasteboard changes
  • Fixed: hs.eventtap.event:setProperty() now accepts 64bit values
  • Fixed: Dark and Light themes in hs.chooser now use more sensible colours/translucency
  • Fixed: hs.screen:gammaGet() now fetches gamma information from the correct display
  • Changed: hs.menubar icons now support colour
  • Changed: hs.eventtap.checkKeyboardModifiers() now also includes unicode modifier characters (e.g. ⌘)
  • Changed: hs.eventtap.keyStroke() and .keyStrokes() now wait 200ms between the keydown and keyup events, to improve reliability
  • Changed: hs.application:findMenuItem() and hs.application:selectMenuItem() can now match menu items via regular expressions
  • Changed: hs.menubar menus can now specify (simple) keyboard shortcuts)
  • Changed: hs.alert appearance is now fully configurable
  • Changed: hs.pasteboard now provides raw data access
  • Changed: hs.audiodevice:setMuted() now returns True on success
  • Changed: hs.timer objects will no longer repeat if the interval is 0 seconds, to prevent users DoSing themselves
  • Changed: hs.location.sunrise() and hs.location.sunset() can now accept a locationTable
  • Added: hs.keycodes.currentSourceID()
  • Added: hs.fs.pathToAbsolute()
  • Added: hs.caffeinate.declareUserActivity()
  • Added: hs.chooser:isVisible(), hs.chooser:rightClickCallback(), hs.chooser:selectedRow()
  • Added: hs.network.configuration:locations(), hs.network.configuration:setLocation()
  • Added: hs.sharing
  • Added: hs.location.geocoder
  • Added: hs.vox

New in Hammerspoon 0.9.48 (Sep 28, 2016)

  • Extensions:
  • Fixed: Small doc bugs in hs.printf and hs.notify.register
  • Fixed: Console window input field now auto-sizes correctly in macOS Sierra
  • Fixed: hs.uielement regressed in 0.9.47. It is now fixed.
  • Fixed: hs.hotkey.bind() regressed in 0.9.47. It is now fixed.
  • Added: hs.screen:desktopImageURL()
  • Added: hs.keycodes.currentMethod()

New in Hammerspoon 0.9.47 (Aug 30, 2016)

  • Core:
  • Changed: Lua has been upgraded to 5.3.3
  • Extensions:
  • Fixed: Various crashes have either been fixed or guarded against
  • Changed: hs.webview now has adjustable opacity and can present a toolbar
  • Changed: hs.timer has been rewritten to use a more modern API, which should make it more reliable
  • Changed: Various fixes/improvements to hs.hint vimperator mode
  • Changed: images can now be used as tiled patterns for hs.drawing.color
  • Changed: hs.alert has been rewritten to use hs.drawing and now has an option to leave the alert visible indefinitely
  • Changed: hs.hotkey callbacks can now be tables with __call metamethods (this will be extended to other callback sites in a future release)
  • Changed: hs.eventtap events now report NSEventTypePressure data, if available
  • Added: hs.distributednotifications
  • Added: hs.eventtap.event.newSystemKeyEvent()
  • Added: hs.httpserver and hs.http now support WebSockets
  • Added: hs.hsdocs for internal documentation browsing
  • Added: hs.image.imageFromURL()
  • Added: hs.mouse.trackingSpeed()
  • Added: hs.noises
  • Added: hs.hints.titleMaxSize and hs.hints.titleRegexSub
  • Added: hs.grid.getCell()
  • Added: hs.timer:fire()
  • Added: hs.network.interfaces(), hs.network.interfaceDetails(), hs.network.primaryInterfaces(), hs.network.addresses(), hs.network.interfaceName(),

New in Hammerspoon 0.9.46 (Apr 15, 2016)

  • Core:
  • Added: basic tab completion to the Console window input field
  • Fixed: some inconsistent behaviours with the Console window input field and multi-line strings
  • Fixed: potential crash relating to launch-at-login
  • Fixed: Lua environment is now gracefully shut down when quitting Hammerspoon from its menubar item
  • Fixed: The 'Open Config' menu item will now default to TextEdit if no default editor for Lua files, exists
  • Extensions:
  • Fixed: hs.image:saveToFile() should be more reliable now
  • Fixed: crash in hs.task
  • Fixed: hs.http handles modified responses correctly now
  • Fixed: hs.location sunrise/sunset calculations are more correct
  • Fixed: hs.javascript should handle parse errors more gracefully
  • Fixed: hs.grid should now move windows more reliably
  • Fixed: hs.audiodevice volume setting
  • Fixed: various bugs in hs.expose
  • Changed: hs.drawing and hs.webview objects can now smoothly fade in/out when they are shown/hidden
  • Changed: hs.sound methods now return the hs.sound object. hs.sound.setCallback renamed to hs.sound.callback
  • Changed: hs.menubar now supports hs.styledtext for menubar items and various other additions
  • Changed: hs.grid can now move windows without resizing them, by selecting a new top-left point and hitting Enter
  • Changed: hs.grid can now be navigated with cursor keys
  • Changed: hs.grid can now use a custom per-screen frame
  • Changed: hs command line tool now has a timeout argument
  • Changed: hs.alert.closeAll() now has an optional duration parameter
  • Changed: hs.fs functions now expand '~' correctly
  • Changed: hs.notify notifications can now include images
  • Changed: hs.redshift colour ramp can now be customised
  • Changed: hs.application:getMenuItems() now includes keyboard shortcut information
  • Added: hs.socket (for tcp/udp/unix sockets, with TLS support)
  • Added: hs.window.hilight
  • Added: hs.window.switcher
  • Added: hs.network.configuration
  • Added: hs.network.host
  • Added: hs.network.reachability
  • Added: hs.osascript
  • Added: hs.image:size(), hs.image:setSize()
  • Added: various hs.pasteboard functions for interacting with different content types on the clipboard
  • Added: more system images to hs.image, hs.image.iconForFile(), hs.image.iconForFileType(), hs.image.imageFromMediaFile()
  • Added: hs.file.fileUTI(),
  • Added: hs.tabs tabs are now clickable
  • Added: hs.audiodevice:inputVolume(), hs.audiodevice:outputVolume(), hs.audiodevice:setInputVolume(), hs.audiodevice:setOutputVolume()
  • Added: hs.wifi.associate()
  • Added: hs.window.filter.defaultCurrentSpace(), hs.window.filter.focusNorth/South/East/West, hs.window.filter.windowsChanged.
  • Added: hs.screen:localToAbsolute(), hs.screen:absoluteToLocal()
  • Added: hs.window:centerOnScreen()
  • Added: hs.application.pathForBundleID(), hs.application:path()

New in Hammerspoon 0.9.45 (Jan 21, 2016)

  • Extensions:
  • Fixed: crash in hs.pasteboard.setImageContents() if it is passed a non-image object
  • Fixed: crash in hs.chooser if it tries to select an impossible row number
  • Fixed: crash in hs.audiodevice.watcher when a watcher object has been deallocated with system events still queued
  • Fixed: crash in hs.screen on display change events (i.e. adding/removing monitors)
  • Fixed: issue with hs.chooser not becoming visible when its :show() method is called, due to Hammerspoon not being the active application
  • Fixed: crash in hs.hotkey related to double-free of carbon hotkeys
  • Fixed: hs.application:name() should work again (although you should ideally use :title() instead)

New in Hammerspoon 0.9.44 (Jan 15, 2016)

  • Core:
  • The bundled version of Lua is now 5.3.2
  • The Hammerspoon community Code of Conduct has been updated to Contributors Covenant 1.3.0
  • Added: hs.printf()
  • Extensions:
  • Fixed: hs.menubar no longer causes WindowServer to log an error when menu items are removed
  • Fixed: hs.drawing should no longer crash on invalid UTF-8 inputs
  • Fixed: various minor issues in hs.grid
  • Fixed: hs.window.filter is now more reliable when "unusual" helper applications are running
  • Fixed: hs.host no longer crashes when iterating volumes while a volume is being removed from the system
  • Fixed: hs.urlevent now handles HTML files being opened by the system, and now works correctly if an http(s) URL, or HTML file, is opened while Hammerspoon is not running
  • Changed: hs.eventtap.event events are now more efficient and reliable
  • Changed: hs.webview now hands unknown URL schemes to the OS
  • Changed: hs.wifi can now perform background scans and return more information about WiFi adapters
  • Added: hs.redshift
  • Added: hs.speech and hs.speech.listener for Text-To-Speech and Speech Recognition, respectively
  • Added: hs.fs.volume
  • Added: hs.chooser
  • Added: hs.task now supports long-running tasks, with callbacks for capturing stdout/stderr
  • Added: hs.task now supports writing data to the stdin of tasks
  • Added: hs.task:workingDirectory(), hs.task:setCallback()
  • Added: hs.console for interacting with the Hammerspoon Console window
  • Added: hs.drawing.arc() for drawing partial circles
  • Added: hs.window.filter.windowAllowed, hs.window.filter.windowRejected, hs.window.filter.hasWindow and hs.window.filter.hasNoWindows events
  • Added: hs.timer.doAt(), hs.timer.delayed() and hs.timer.localTime()
  • Added: hs.setLogLevel()
  • Added: hs.logger now keeps a small history buffer
  • Added: .getVolume(), .setVolume(), .volumeUp(), .volumeDown(), .getPosition(), .setPosition(), .ff() and .rw() to hs.itunes and hs.spotify
  • Added: hs.caffeinate.watcher now supports events for screensaver activity and Fast User Switching activity
  • Removed: hs.crash.isMainThread() as we now perform this check automatically in almost all internal functions

New in Hammerspoon 0.9.43 (Nov 17, 2015)

  • Core:
  • Improved the icon for non-retina screens
  • LuaSkin API documentation is now published at http://www.hammerspoon.org/docs/LuaSkin/
  • Force OS X to not try and place Hammerspoon in AppNap
  • Updated Crashlytics.framework to 3.4.0
  • Extensions:
  • Fixed: hs.expose is now correctly included in the application
  • Fixed: hs.screen.find() by screen ID now works correctly
  • Fixed: hs.drawing:setImageFromPath() and hs.drawing:setImageFromASCII() now work correctly
  • Changed: The desktop is now excluded from hs.window.allWindows()
  • Changed: The play() functions in hs.spotify and hs.itunes no longer toggle between play and pause
  • Changed: hs.layout now defaults to using the main screen if it encounters a problem finding a screen
  • Changed: hs.application.nameForBundleID() now returns the full application name, not the name of its executable
  • Added: hs.window.desktop()
  • Added: hs.audiodevice can now inspect device datasources and watch for configuration changes and device addition/removal
  • Added: hs.audiodevice.watcher for observing changes on specific audio devices (e.g. headphone insertion/removal)
  • Added: hs.audiodevice.findDeviceByName(), hs.audiodevice.findOutputDeviceByUID(), hs.audiodevice.findInputDeviceByUID(), hs.audiodevice:jackConnected()
  • Added: hs.spotify.playpause(), hs.spotify.getPlayerState(), hs.spotify.isRunning(), hs.spotify.isPlaying()
  • Added: hs.itunes.playpause(), hs.itunes.getPlayerState(), hs.itunes.isRunning(), hs.itunes.isPlaying()
  • Added: hs.application:isRunning()
  • Added: hs.screen:getBrightness(), hs.screen:setBrightness() (separate from hs.brightness because they are able to work on Apple external displays)
  • Added: hs.menubar:frame()
  • Added: hs.styledtext (highly configurable text styling for hs.drawing)
  • Added: hs.javascript (analogous to hs.applescript)
  • Added: hs.pasteboard.getImageContents(), hs.pasteboard.setImageContents()
  • Added: hs.task (asynchronous execution of external binaries)
  • Added: hs.host.volumeInformation()
  • Added: hs.keycodes.layouts(), hs.keycodes.currentLayout(), hs.keycodes.setLayout()
  • Added: hs.drawing:frame()

New in Hammerspoon 0.9.42 (Oct 9, 2015)

  • Core:
  • Tweaked the icon to have richer colours and better alignment
  • Intrepid users can now use defaults(1) to change the directory Hammerspoon will load its config file from
  • Extensions:
  • Fixed: hs.drawing:setFillGradient() now works again
  • Fixed: hs.http should be more robust against crashing on bad function arguments
  • Fixed: hs.drawing should be more robust against crashing when unknown fonts are requested
  • Changed: hs.hints can now optionally include non-standard windows in its hints display
  • Changed: hs.application.open() can now optionally block Hammerspoon until a window appears for the application
  • Changed: hs.expose improvements
  • Added: hs.logger.getLogLevel()
  • Added: hs.window.setFrameCorrectness(), hs.window.setFrameWithWorkarounds()
  • Added: hs.drawing.color[] now contains a few more pre-defined colours. Please send in Pull Requests adding lots more!

New in Hammerspoon 0.9.41 (Sep 30, 2015)

  • Extensions:
  • Fixed: Fix a garbage collection bug in hs.milight
  • Fixed: hs.drawing should now be usable on 10.8
  • Changed: hs.hotkey events can now optionally show an message on screen (to make it easier to see what you did)
  • Changed: hs.hotkey now defines and enforces behaviour when multiple hotkeys with the same modifiers/key are configured
  • Changed: hs.hotkey keycodes no longer need to be prefixed by #
  • Changed: hs.host no longer pre-caches host address data. This makes the call slower, but means the data is never stale
  • Changed: hs.layout can now accept hs.application objects as well as application names
  • Changed: hs.grid improvements
  • Changed: hs.window.filter improvements
  • Changed: hs.drawing objects now try not to raise other Hammerspoon Windows when they are clicked
  • Added: hs.hotkey.showHotkeys(), hs.hotkey.getHotkeys(), hs.hotkey.alertDuration
  • Added: hs.window:setFrameInScreenBounds(), hs.window:raise(), hs.window:sendToBack()
  • Added: hs.screen:toUnitRect()
  • Added: hs.window.tiling (currently deemed experimental)
  • Added: hs.window.layout (currently deemed experimental)
  • Added: hs.webview

New in Hammerspoon 0.9.40 (Sep 9, 2015)

  • Extensions:
  • Fixed: hs.screen object methods were broken in 0.9.39, and are now fixed
  • Fixed: hs.alert now correctly handles multiple monitors
  • Fixed: hs.window.ensureIsInScreenBounds() now interacts properly with window animations
  • Fixed: hs.milight was broken in 0.9.39, and is now fixed
  • Fixed: hs.httpserver now works correctly with SSL, on OS X 10.11
  • Changed: hs.window.allWindows() should now be significantly faster
  • Changed: hs.layout.apply() now matches window titles as Lua patterns
  • Added: hs.timer:setNextTrigger()
  • Added: hs.window.find() and hs.application.find(), which effectively deprecate hs.appfinder
  • Added: hs.window.get(), hs.window.move()
  • Added: hs.application.open(), hs.application.get(), hs.application:getWindow(), hs.application:findWindow()
  • Added: hs.urlevent can now register Hammerspoon as the default handler for http/https URLs, and adds API for managing that
  • Added: hs.drawing:setLevel(), hs.drawing.windowLevels
  • Added: hs.geometry:floor(), hs.geometry.string, hs.geometry.table and various other improvements to hs.geometry
  • Added: hs.window.filter.copy()

New in Hammerspoon 0.9.39 (Sep 2, 2015)

  • Core:
  • The build system for extensions has changed from our custom Makefile/script setup, to Xcode. This should not produce any noticeable changes for users, but if it does, please file issues at GitHub!
  • Almost all extensions are now making extensive use of our LuaSkin framework for registering their functions with Lua, and calling Lua callbacks. This should also not produce any noticeable changes for users, but if it does, please file issues at GitHub!
  • Many of the userdata objects created by extensions, now have __tostring methods, which makes inspecting them in the Hammerspoon Console, easier.
  • Extensions:
  • Fixed: hs.base64.encode() no longer truncates its output
  • Fixed: hs.ipc no longer leaks CFMessagePortRefs
  • Fixed: hs.spaces.watcher no longer leaks window lists
  • Fixed: hs.menubar crash with nil menu item names
  • Fixed: Console window output should now be more UTF8-safe
  • Changed: hs.windowfilter has seen numerous improvements and has been renamed to hs.window.filter
  • Changed: Various hs.fnutils iterators have slightly changed their behaviours
  • Changed: hs.grid will now use hs.window.frontmostWindow() instead of hs.window.focusedWindow(), which should be more intuitive for users
  • Changed: hs.timer timers will now stop firing if the Lua callback generates an error (although this behaviour can be overridden)
  • Changed: hs.notify has been partially rewritten and should be more reliable
  • Changed: Object methods in hs.caffeinate and hs.eventtap.event now return their object (i.e. to enable method chaining)
  • Changed: hs.geometry is now significantly more powerful
  • Changed: hs.grid.show() can now be used to iterate through multiple windows
  • Added: hs.screen.primaryScreen(), hs.screen.screenPositions(), hs.screen:position()
  • Added: hs.drawing.setTextStyle(), hs.drawing.getTextDrawingSize()
  • Added: hs.timer:nextTrigger()
  • Added: hs.audiodevice can now operate on input devices as well as output devices.
  • Added: hs.expose
  • Added: hs.screen.find() and hs.screen:fromUnitRect()

New in Hammerspoon 0.9.38 (Aug 6, 2015)

  • Core:
  • This release is happening quickly after 0.9.37 to correct an issue with Crashlytics symbols, apologies for the churn!
  • Extensions:
  • Fixed: potential crash in hs.drawing.setBehaviour()
  • Changed: hs.mouse.get/set (deprecated) now warn when they are used.
  • Added: hs.host.interfaceStyle(), hs.host.uuid(), hs.host.globallyUniqueString()
  • Added: hs.fs.temporaryDirectory()
  • Added: various helper functions in hs.timer

New in Hammerspoon 0.9.37 (Aug 6, 2015)

  • Core:
  • The About window now shows acknowledgements for third party libraries, including their licenses
  • API documentation formatting is now much tidier
  • Hammerspoon preferences can now (mostly) be interacted with from Lua
  • Extensions:
  • Fixed: Various hs.windowfilter bugs have been fixed
  • Fixed: hs.menu submenus can how have items enabled or disabled
  • Changed: hs.image/hs.application/hs.window objects can now be print()ed in the Console, to get more information about them
  • Changed: hs.grid overlay hints now work up to 10x10 (previously 5x5)
  • Changed: hs.windowfilter:notify() now has an optional parameter to cause callbacks to be called immediately
  • Changed: hs.image objects can now be directly compared for equality
  • Changed: hs.drawing objects can now respond to mouseDown events and middle/right mouse button events
  • Changed: hs.image.imageFromASCII() now has an optional parameter to define metadata about the drawing styles to be used
  • Added: hs.menubar:title() and hs.menubar:icon()
  • Added: hs.httpserver
  • Added: hs.screen.findByID()
  • Added: hs.logger.defaultLogLevel is now explicitly defined and configurable

New in Hammerspoon 0.9.36 (Aug 6, 2015)

  • Extensions:
  • Fixed: hs.window:snapshot() works more reliably for hidden/minimized windows
  • Changed: Various improvements to hs.doc and help()
  • Changed: hs.utf8 is mostly backed onto the UTF8 library in Lua 5.3
  • Added: hs.windowfilter (NOTE: This is considered experimental at this stage, please test it!)
  • Added: hs.appfinder.windowFromWindowTitlePattern()
  • Added: hs.grid.toggleShow()
  • Added: hs.battery.psuSerial()
  • Added: hs.pasteboard.contentTypes() and hs.pasteboard.pasteboardTypes()
  • Added: hs.host.operatingSystemVersion() and hs.host.operatingSystemVersionString()
  • Added: hs.utf8.registeredLabels()
  • Added: hs.menubar menus can now be presented as popup menus anywhere on the screen
  • Added: hs.eventtap.scrollWheel() and hs.eventtap.event.newScrollWheelEvent()
  • Added: hs.window.snapshotForID()

New in Hammerspoon 0.9.35 (Aug 6, 2015)

  • Extensions:
  • Fixed: ASCII image creation regression in 0.9.34
  • Added: hs.grid.hide()

New in Hammerspoon 0.9.34 (Aug 6, 2015)

  • Core:
  • API documentation now has a nice CSS theme (thanks @jasonm23)
  • Extensions:
  • Changed: hs.screen:toEast()/toWest()/toNorth()/toSouth() are now stricter about which screen they should choose (with an optional parameter to be non-strict)
  • Changed: hs.alert windows now render at the highest possible window level (i.e. on top of all other windows)
  • Changed: hs.spaces.watcher:start()/stop() are now chainable
  • Changed: More hs.window methods are now chainable
  • Changed: hs.eventtap.checkKeyboardModifiers() now also returns the state of capslock, and optionally can return the raw modifier status
  • Changed: hs.grid is now much more capable and can operate on per-screen grids
  • Fixed: hs.pasteboard.setContents() now works correctly
  • Fixed: an hs.uielement crash
  • Fixed: an hs.hints crash on applications with no proper bundle
  • Fixed: an hs.image crash
  • Fixed: hs.urlevent callback errors are now propagated correctly
  • Added: hs.timer.secondsSinceEpoch() for getting high resolution time
  • Added: hs.host.cpuUsage["overall"]
  • Added: hs.screen.findByName()
  • Added: hs.eventtap now handles more events (mainly simply gestures)
  • Added: hs.image for creating image objects for other modules (hs.drawing, hs.menubar)
  • Added: hs.hash for performing SHA1/256/512 and MD5 hashes
  • Added: hs.screen:snapshot() for getting an hs.image object of the screen
  • Added: hs.grid.show() for quickly resizing windows with a visual overlay
  • Added: hs.drawing can now configure behaviours on its objects, affecting their behaviour with Spaces/MissionControl/Expose

New in Hammerspoon 0.9.33 (Aug 6, 2015)

  • Extensions:
  • Fixed: hs.host crash in garbage collection
  • Added: HTML entity decoding helpers to hs.http
  • Added: vmStat and cpuUsage to hs.host
  • Added: Information about system settings for keyboard repeat and mouse doubleclick

New in Hammerspoon 0.9.31 (May 25, 2015)

  • Extensions:
  • Changed: hs.event.keyStroke() converts the character to lower-case. If you need upper-case, pass "shift" in the modifiers table
  • Added: hs.application.launchOrFocusByBundleID() to launch apps by their unique bundle identifier
  • Added: hs.brightness.ambient() to read lux values from the ambient light sensor in MacBooks
  • Added: hs.drawing.image() and hs.menubar:setIcon() now accept a special form of ASCII diagrams, which will be converted into an image

New in Hammerspoon 0.9.30 (May 14, 2015)

  • CORE:
  • Crashlytics has been updated to the new Fabric framework, which Crashlytics is now part of. This should not affect users in any way
  • Fix various deficient extension credits, for extensions inherited from Hydra/Mjolnir
  • EXTENSIONS:
  • Fixed: hs.eventtap.event.keyStrokes() is now more efficient
  • Fixed: hs.drawing.newText() no longer crashes if its optional parameters are not passed
  • Fixed: Various extensions are now more careful with string parameters, which could previously cause crashes
  • Fixed: hs.grid no longer emits errors for unusual windows that have no value for :screen()
  • Fixed: hs.drawing methods can no longer cause crashes by being called against the wrong type of drawing object
  • Fixed: hs.menubar dynamic menus no longer cause Hammerspoon to crash if the menu generator callback returns the wrong datatype
  • Fixed: hs.uielement is now more robust in the face of errors when creating an object
  • Fixed: hs.eventtap.event no longer leaks one CGEventSourceRef per event
  • Fixed: hs.drawing no longer renders objects in the wrong place on non-primary displays
  • Changed: hs.event.keyStroke() no longer supports sending multiple keystrokes (see hs.event.keyStrokes() for that)
  • Changed: hs.hints.windowHints() now supports a callback function
  • Added: hs.http for making simple and complex HTTP requests
  • Added: hs.usb.watcher for reacting to USB device insertions/removals
  • Added: hs.drawing:setTextFont() for changing the font of a drawing object
  • Added: hs.host for inspecting network address/name information

New in Hammerspoon 0.9.29 (Apr 17, 2015)

  • Extensions:
  • Fixed: hs.hints now works with more unusual windows, such as Steam
  • Fixed: hs.menubar menu entry disabling now works as documented
  • Fixed: hs.screen gamma related functions now have the correct names in API docs
  • Fixed: hs.eventtap.event.newMouseEvent()'s 4th parameter is now optional, as documented
  • Changed: hs.hints.windowHints() now accepts an optional threshold for showing window titles, to help avoid cluttering the screen
  • Changed: hs.grid resizing functions now work in more cases, e.g. resizing even if a window is at the screen edge already, but has space to grow in the other direction
  • Changed: hs.hotkey.modal hotkeys can now supply a callback for repeat events
  • Added: hs.caffeinate.watcher for reacting to system power events (display sleep/wake, system sleep/wake)

New in Hammerspoon 0.9.28 (Apr 3, 2015)

  • CORE:
  • Fixed: Lua exceptions raised by code in the Hammerspoon Console should no longer cause the whole app to abort()
  • EXTENSIONS:
  • Fixed: Prospective fixes for crash bugs in hs.application.watcher, hs.eventtap.event and hs.application
  • Fixed: hs.drawing objects are now correctly garbage collected across configuration reloads
  • Changed: hs.itunes and hs.spotify return nil on errors in their getFoo() functions, instead of a table of Applescript error information
  • Added: hs.screen.setShadows()
  • Added: hs.screen.getGamma(), hs.screen.setGamma() and hs.screen.restoreGamma() for inspecting/manipulating the white and black points of monitor gamma curves
  • Removed: hs.screen.setTint(), which was impossibly unfriendly to use, almost entirely undocumented, and is superceded by the preceeding fooGamma() function/methods

New in Hammerspoon 0.9.27 (Mar 23, 2015)

  • NOTE:
  • The hs.spotify extension is reported to not be working with the latest Spotify client, due to changes in their AppleScript support. This will be addressed in a future Hammerspoon release (possibly by removing hs.spotify, if it is no longer workable)
  • CORE:
  • Changed: Lua callbacks from C/ObjC extensions should now be unable to corrupt the Lua function registry if they are overfreed (which is a known bug in hs.notify)
  • EXTENSIONS:
  • Changed: hs.itunes and hs.spotify no longer display an hs.alert for each operation.
  • Changed: hs.window.windowsTo{East,West,North,South} now attempt to take window z-order into account when ordering windows by proximity
  • Added: hs.urlevent for reacting to hammerspoon:// URLs being opened by other apps (i.e. this is another way to do IPC with Hammerspoon)

New in Hammerspoon 0.9.26 (Mar 16, 2015)

  • NOTE:
  • There are two API changes in this release, both in hs.eventtap. See the Extensions section below for more information
  • CORE:
  • Added: Preferences window now includes an option to disable sending crash reports, and a link to our privacy policy for crash reports. We would humbly request that you not disable the crash reports, as they are super helpful to us in improving Hammerspoon.
  • Added: Crash reports now include the location of C libraries loaded by Hammerspoon (we are trying to track down some crashes that make no sense and may be coming from stale on-disk libraries)
  • EXTENSIONS:
  • Fixed: hs.notify should no longer cause crashes
  • Changed: hs.eventtap.newKeyEvent() modifier table has changed. Values are now inspected, rather than keys.
  • Changed: hs.eventtap.keyStrokes() has been replaced with a different implementation that no longer accepts a modifiers table. The old implementation (which was always more suited to sending single key strokes) is still available, as hs.eventtap.keyStroke()
  • Changed: hs.pasteboard functions can now work with named pasteboards (useful for integrating with other automation tools)
  • Added: hs.drawing objects can now be filled with linear gradients
  • Added: hs.drawing.rectangle() objects can now be rounded rects
  • Added: hs.drawing.image() for rendering simple pictures on-screen (including animated GIFs)
  • Added: hs.usb for enumerating currently attached USB devices (in a future release, this will also be able to watch device insertions/removals)

New in Hammerspoon 0.9.25 (Mar 9, 2015)

  • Core:
  • Extensions:
  • Fixed: hs.eventtap.event.newKeyEvent() now actually works!
  • Added: hs.screen:rotate()
  • Added: hs.timer.usleep() for times when you are feeling crazy and want to block all of Hammerspoon for a few microseconds
  • Added: hs.hotkey now offers an optional repeat callback for when hotkeys are being held down
  • Changed: hs.hints.windowHints() now has an optional parameter to accept a table of windows to limit hints to (e.g. windows from the current application)
  • Changed: hs.eventtap.event mouse events now explicitly mask off keyboard modifiers, or can optionally specify particular modifiers
  • Changed: hs.drawing methods now return the object they are operating on, so you can chain the calls
  • Changed: hs.hotkey.new() now accepts raw keycodes

New in Hammerspoon 0.9.24 (Mar 2, 2015)

  • Extensions:
  • Fixed: hs.drawing stroke/fill API calls should now perform more like they claim to
  • Added: hs.drawing now supports rectangles
  • Added: hs.crash.dumpCLIBS() and hs.crash.crashLog() to allow Lua code to leave logging breadcrumbs in Crashalytics reports
  • Added: hs.window:zoomButtonRect() to make it possible to easily find an area of titlebar to synthesise mouse events onto

New in Hammerspoon 0.9.23 (Feb 26, 2015)

  • CORE:
  • Extensions:
  • Fixed: hs.layout now selects a default screen more carefully
  • Changed: hs.menubar callbacks can now inspect which keyboard modifiers are being held, so they can take different actions
  • Changed: hs.layout.apply() can now accept a function to decide which screen to place a window on
  • Added: hs.messages (for sending iMessage/SMS via the Messages.app)
  • Added: hs.drawing (for drawing very simple things on screen - circles, lines, text)
  • Added: hs.screen:currentMode(), hs.screen:availableModes(), hs.screen:setMode() (for inspecting/configuring monitor resolutions)

New in Hammerspoon 0.9.22 (Feb 18, 2015)

  • CORE:
  • Extensions:
  • Fixed: Prevent a crash in hs.hotkey
  • Fixed: hs.hints will no longer flow window hint icons off the bottom of the screen
  • Fixed: Many extensions now have correctly formatted documentation. This is still a work in progress.
  • Changed: hs.uielemet now uses a more relaxed method of determining if an object is a window. This should help with unusual apps like Emacs.
  • Added: Added getCurrentArtist(), getCurrentAlbum() and getCurrentTrack() to hs.itunes and hs.spotify
  • Added: hs.window.focusWindowNorth/South/East/West() can now limit their search to windows from the same application

New in Hammerspoon 0.9.21 (Feb 5, 2015)

  • CORE:
  • Extensions:
  • Fixed: hs.mouse.setAbsolutePosition() is now defined correctly

New in Hammerspoon 0.9.20 (Feb 3, 2015)

  • Core:
  • Extensions:
  • Changed: hs.mouse now understands multiple displays more usefully. Please update your usage of hs.mouse.set() / hs.mouse.get() to hs.mouse.getAbsolutePosition() and hs.mouse.setAbsolutePosition()
  • Added: hs.caffeinate.lockScreen(), hs.caffeinate.startScreensaver(), hs.caffeinate.rebootSystem() and hs.caffeinate.shutdownSystem()
  • Added: hs.mouse.getRelativePosition(), hs.mouse.setRelativePosition and hs.mouse.getCurrentScreen()
  • Added: hs.geometry.isPointInRect
  • Added: hs.alert.closeAll
  • Added: hs.application.focusedWindow() and hs.application:isFrontmost()

New in Hammerspoon 0.9.19 (Jan 24, 2015)

  • CORE:
  • Changed: hs.layout now defaults to placing windows on the first screen, if nothing is specified
  • Fixed: hs.keycodes's inputSourceChanged callbacks should no longer cause Hammerspoon to crash
  • Fixed: hs.hotkey callbacks should no longer cause Hammerspoon to crash
  • Fixed: hs.caffeinate is slightly more robust
  • Fixed: memory leaks in hs.ipc, hs.screen and hs.uielement

New in Hammerspoon 0.9.18 (Jan 19, 2015)

  • CORE:
  • Changed: API documentation format has been dramatically improved
  • Added: hs.toggleConsole() to toggle visibility of the Hammerspoon Console window
  • EXTENSIONS:
  • Changed: hs.hints.windowHints() no longer forces you to type a second character for windows that are uniquely matched by the first hint character
  • Changed: All hs.window methods which change the size/position of a window, now have an optional argument to override the value of hs.window.animationDuration
  • Added: Various helper methods in hs.window to move a window by one screen in any direction
  • Changed: hs.layout.apple() can now accept hs.screen objects instead of screen names, for users with multiple identical monitors

New in Hammerspoon 0.9.17 (Jan 16, 2015)

  • CORE:
  • Extensions:
  • Fixed: Guard against a crashing bug in hs.uielement:newWatcher()
  • Changed: hs.notify now supports many more features of Notification Center. NOTE: The old API still exists, but is now deprecated. Please port to the new hs.notify API.
  • Changed: hs.hints.windowHints() now shows hints for more application windows
  • Changed: hs.hotkey now supports the § key found on some international Mac keyboards
  • Changed: hs.location can now calculate sunrise/sunset times

New in Hammerspoon 0.9.16 (Jan 10, 2015)

  • CORE:
  • Extensions:
  • Fixed:
  • hs.hotkey should be less likely to crash in confusing edge cases
  • Changed:
  • Added hs.window.toggleZoom(), which mirrors the behaviour of the OS X window zoom button (pre Yosemite)
  • Added hs.crash.isMainThread() to aid debugging odd callback related crashes
  • hs.alert() is now callable, to reduce repetition

New in Hammerspoon 0.9.15 (Jan 8, 2015)

  • Core:
  • Fixed: Various nasty thread-related crasher bugs have been squashed
  • Fixed: help() function was using an incorrect call from hs.doc
  • Fixed: developer sample extensions are now correctly formatted
  • Extensions:
  • Changed: Added hs.application.frontmostApplication
  • Fixed: hs.hints.windowHints() is now more efficient and smarter about edge cases (e.g. no windows being open)
  • Changed: Font name and size are now configurable for hs.hints.windowHints()