HSWindow
Type
Object representing a window. You should not instantiate these directly, but rather, use the methods in hs.window to create them for you.
Properties
application
HSApplication
The application that owns this window
pid
number
The process ID of the application that owns this window
isMinimized
boolean
Whether the window is minimized
isVisible
boolean
Whether the window is visible (not minimized or hidden)
isFullscreen
boolean
Whether the window is fullscreen
isStandard
boolean
Whether the window is standard (has a titlebar)
position
HSPoint
The window's position on screen {x: Int, y: Int}
frame
HSRect
The window's frame {x: Int, y: Int, w: Int, h: Int}
screen
HSScreen
The screen that contains the largest portion of this window.
Methods
focus()
Focus this window
Hammerspoon 2/Modules/hs.window/HSWindow.swift:61
Parameters
None
Returns
boolean - true if successful
minimize()
Minimize this window
Hammerspoon 2/Modules/hs.window/HSWindow.swift:65
Parameters
None
Returns
boolean - true if successful
unminimize()
Unminimize this window
Hammerspoon 2/Modules/hs.window/HSWindow.swift:69
Parameters
None
Returns
boolean - true if successful
raise()
Raise this window to the front
Hammerspoon 2/Modules/hs.window/HSWindow.swift:73
Parameters
None
Returns
boolean - true if successful
toggleFullscreen()
Toggle fullscreen mode
Hammerspoon 2/Modules/hs.window/HSWindow.swift:77
Parameters
None
Returns
boolean - true if successful
close()
Close this window
Hammerspoon 2/Modules/hs.window/HSWindow.swift:81
Parameters
None
Returns
boolean - true if successful
centerOnScreen()
Center the window on the screen
Hammerspoon 2/Modules/hs.window/HSWindow.swift:85
Parameters
None
Returns
Nothing
axElement()
Get the underlying AXElement
Hammerspoon 2/Modules/hs.window/HSWindow.swift:91
Parameters
None
Returns
HSAXElement - The accessibility element for this window