Skip to content

window-class

The Window class defines these static properties and functions. Window instances created with new Window() do not have these properties and functions defined.


Window.frameworkName

String


Window.version

String


Access these function through the class. For example:

Window.alert("Notification to user");

Window.alert(message[, title="Script Alert", errorIcon=false]);

Displays a platform-standard dialog containing a short message and an OK button.

ParameterTypeDescription
messageStringThe string for the displayed message.
titleStringOptional. A string to appear as the title of the dialog, if the platform supports a title. Mac OS does not support titles for alert dialogs. The default title string is "Script Alert"
errorIconBooleanOptional. When true, the platform-standard alert icon is replaced by the platform-standard error icon in the dialog. Default is false.

Nothing


Window.confirm(message[, noAsDflt=false, title="Script Alert"]);

Displays a platform-standard dialog containing a short message and two buttons labeled “Yes” and “No”.

ParameterTypeDescription
messageStringThe string for the displayed message.
noAsDfltBooleanOptional. When true, the No button is the default choice, selected when the user types ENTER. Default is false, meaning that Yes is the default choice.
titleStringOptional. A string to appear as the title of the dialog, if the platform supports a title. Mac OS does not support titles for confirmation dialogs. The default title string is "Script Alert"

Boolean. true if the user clicked “Yes”, false if the user clicked “No”.


Window.find(resourceName)

Window.find(type, title)

Use this method to find an existing window. This includes windows already created by a script, and windows created by the application (if the application supports this case).

Not supported in all ScriptUI implementations.

ParameterTypeDescription
resourceNameStringThe name of a predefined resource available to JavaScript in the current application.
typeStringOptional. The window type (see Window object constructor) used if there is more than one window with the same title. Can be null or the empty string.
titleStrignThe window title.

Window object found or generated from the resource, or null if no such window or resource exists.


Window.prompt(message, preset[, title="Script Prompt"]);

Displays a modal dialog that returns the user’s text input.

ParameterTypeDescription
messageStringThe string for the displayed message.
presetStringThe initial value to be displayed in the text edit field.
titleStringOptional. A string to appear as the title of the dialog. In Windows, this appears in the window’s frame; in Mac OS it appears above the message. The default title string is "Script Prompt".

Returns the value of the text edit field if the user clicked OK, null if the user clicked Cancel.