hammerspoon2-docs
    Preparing search index...

    Function focusedWindow

    • Get the currently focused window

      This is the window with keyboard focus, which isn't always a window of hs.application.frontmost(): panels that take focus without activating their app (such as Spotlight's search panel) are returned too.

      Returns HSWindow | null

      The focused window, or nil if none