Skip to content
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.

Description

The Application Object represents a currently running application.

Functions

pid

Return the Process Identifier of the Application.

// assuming app is the Application Object
var pid = app.pid();

name

Return the name of the Application.

// assuming app is the Application Object
var name = app.name();

eachWindow

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.

mainWindow

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();
Clone this wiki locally