Object representing an application. You should not instantiate this directly in JavaScript, but rather, use the methods from hs.application which will return appropriate HSApplication objects.

Properties

bundleID

string

Bundle Identifier (e.g. com.apple.Safari)

bundlePath

string

Location of the application on disk

isHidden

boolean

Is the application hidden

isActive

boolean

Is the application focused

mainWindow

HSWindow

The main window of this application, or nil if there is no main window

focusedWindow

HSWindow

The focused window of this application, or nil if there is no focused window

allWindows

HSWindow[]

All windows of this application

visibleWindows

HSWindow[]

All visible (ie non-hidden) windows of this application

Methods

kill()

Terminate the application

Parameters

None

Returns

boolean - True if the application was terminated, otherwise false

kill9()

Force-terminate the application

Parameters

None

Returns

boolean - True if the application was force-terminated, otherwise false

axElement()

The application's HSAXElement object, for use with the hs.ax APIs

Parameters

None

Returns

HSAXElement - An HSAXElement object, or nil if it could not be obtained