Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Bring All Finder Windows To Front With Hammerspoon

One annoyance with macOS is switching to the Finder in Alfred only brings one window forward. Others remain hidden behind the prior app.

I'm solving that with Hammerspoon. This snippet triggers the "Bring All to Front" menu item in the Finder whenever it's activated.

~/.hammerspoon/bring-finder-to-front.lua

local function finderWatcher(app, event, appObj) 
  if app == "Finder" then
    if event == hs.application.watcher.activated then
      appObj:selectMenuItem("Bring All to Front")
    end
  end
end

local appWatcher = hs.application.watcher.new(finderWatcher)
appWatcher:start()

References