HSApplication
Type
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
Hammerspoon 2/Modules/hs.application/HSApplication.swift:35
Parameters
None
Returns
boolean - True if the application was terminated, otherwise false
kill9()
Force-terminate the application
Hammerspoon 2/Modules/hs.application/HSApplication.swift:39
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
Hammerspoon 2/Modules/hs.application/HSApplication.swift:55
Parameters
None
Returns
HSAXElement - An HSAXElement object, or nil if it could not be obtained