-
Notifications
You must be signed in to change notification settings - Fork 512
Application Object
snarfed edited this page Mar 31, 2013
·
7 revisions
The Application Object is returned by various Slate API functions. This page describes it in detail.
The Application Object represents a currently running application.
Return the Process Identifier of the Application.
// assuming app is the Application Object
var pid = app.pid();
Return the name of the Application.
// assuming app is the Application Object
var name = app.name();
Alias: ewindow
Loop over each window within the Application and run a function for each one.
// assuming app is the Application Object
var name = app.eachWindow(function(windowObject) {
// do something with windowObject
});
-
windowObject
- a window object representing the current window in the loop.
Alias: mwindow
Return the main window of the Application or undefined
if there is none.
// assuming app is the Application Object
var mainWindow = app.mainWindow();