docs » cp.ui.Window


A Window UI element.

API Overview

  • Functions - API calls offered directly by the extension
  • Constructors - API calls which return an object, typically one that offers API methods
  • Fields - Variables which can only be accessed from an object returned by a constructor
  • Methods - API calls which can only be made on an object returned by a constructor

API Documentation

Functions

matches

Signature cp.ui.Window.matches(element) -> boolean
Type Function
Description Checks if the provided element is a valid window.

Constructors

new

Signature cp.ui.Window:new(finderFn) -> Window
Type Constructor
Description Creates a new Window
Parameters
  • `finderFn` - a function which will provide the `axuielement` for the window to work with.
Returns
  • A new `Window` instance.

Fields

exists

Signature cp.ui.Window.exists <cp.prop: boolean; read-only>
Type Field
Description Returns true if the window exists. It may not be visible.

focused

Signature cp.ui.Window.focused <cp.prop: boolean>
Type Field
Description Is true if the window has mouse/keyboard focused.

frame

Signature cp.ui.Window.frame <cp.prop: hs.geometry rect>
Type Field
Description The hs.geometry rect value describing the window's position.

fullScreen

Signature cp.ui.Window.fullScreen <cp.prop: boolean>
Type Field
Description Returns true if the window is full-screen.

hsWindow

Signature cp.ui.Window.hsWindow <cp.prop: hs.window; read-only>
Type Field
Description The hs.window instance for the window, or nil if it can't be found.

id

Signature cp.ui.Window.id <cp.prop: number; read-only>
Type Field
Description The unique ID for the window.

minimized

Signature cp.ui.Window.minimized <cp.prop: boolean>
Type Field
Description Returns true if the window exists and is minimised.

UI

Signature cp.ui.Window.UI <cp.prop: axuielement; read-only>
Type Field
Description Returns the axuielement UI for the window, or nil if it can't be found.

visible

Signature cp.ui.Window.visible <cp.prop: boolean; read-only>
Type Field
Description Returns true if the window is visible on a screen.

Methods

close

Signature cp.ui.Window.close() -> boolean
Type Method
Description Attempts to close the window.
Parameters
  • * None
Returns
  • * `true` if the window was successfully closed.

focus

Signature cp.ui.Window.focus() -> boolean
Type Method
Description Attempts to focus the window.
Parameters
  • * None
Returns
  • * `true` if the window was successfully focused.

results matching ""

    No results matching ""