hammerspoon2-docs
    Preparing search index...

    Function frontmostWindow

    • Get the frontmost window

      This is the focused window or, if no window has focus (for example when the desktop is clicked, or the active application has no windows open), the window in front of all the others, from orderedWindows().

      Returns HSWindow | null

      The frontmost window, or nil if there are no windows