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)

isFocused

boolean

Whether the window is focused

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}

size

HSSize

The window's size {w: Int, h: 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

Parameters

None

Returns

boolean - true if successful

minimize()

Minimize this window

Parameters

None

Returns

boolean - true if successful

unminimize()

Unminimize this window

Parameters

None

Returns

boolean - true if successful

raise()

Raise this window to the front

Parameters

None

Returns

boolean - true if successful

toggleFullscreen()

Toggle fullscreen mode

Parameters

None

Returns

boolean - true if successful

close()

Close this window

Parameters

None

Returns

boolean - true if successful

centerOnScreen()

Center the window on the screen

Parameters

None

Returns

Nothing

axElement()

Get the underlying AXElement

Parameters

None

Returns

HSAXElement - The accessibility element for this window