window-class
Window class
Section titled “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 Class Attributes
Section titled “Window Class Attributes”Window.frameworkName
Section titled “Window.frameworkName”Window.frameworkName
Description
Section titled “Description”String
Window.version
Section titled “Window.version”Window.version
Description
Section titled “Description”String
Window Class Methods
Section titled “Window Class Methods”Access these function through the class. For example:
Window.alert("Notification to user");
alert()
Section titled “alert()”Window.alert(message[, title="Script Alert", errorIcon=false]);
Description
Section titled “Description”Displays a platform-standard dialog containing a short message and an OK button.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
message | String | The string for the displayed message. |
title | String | Optional. 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" |
errorIcon | Boolean | Optional. When true , the platform-standard alert icon is replaced by the platform-standard error icon in the dialog. Default is false . |
Returns
Section titled “Returns”Nothing
confirm()
Section titled “confirm()”Window.confirm(message[, noAsDflt=false, title="Script Alert"]);
Description
Section titled “Description”Displays a platform-standard dialog containing a short message and two buttons labeled “Yes” and “No”.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
message | String | The string for the displayed message. |
noAsDflt | Boolean | Optional. 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. |
title | String | Optional. 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" |
Returns
Section titled “Returns”Boolean. true
if the user clicked “Yes”, false
if the user clicked “No”.
find()
Section titled “find()”Window.find(resourceName)
Window.find(type, title)
Description
Section titled “Description”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.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
resourceName | String | The name of a predefined resource available to JavaScript in the current application. |
type | String | Optional. 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. |
title | Strign | The window title. |
Returns
Section titled “Returns”Window object found or generated from the resource, or null
if no such window or resource exists.
prompt()
Section titled “prompt()”Window.prompt(message, preset[, title="Script Prompt"]);
Description
Section titled “Description”Displays a modal dialog that returns the user’s text input.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
message | String | The string for the displayed message. |
preset | String | The initial value to be displayed in the text edit field. |
title | String | Optional. 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
Section titled “Returns”Returns the value of the text edit field if the user clicked OK, null
if the user clicked Cancel.