
CHAPTER 4: User-Interface Tools Window object 112
Window object
Window object constructor
The constructor creates and returns a new Window object, or null if window creation failed.
new Window (type [, title, bounds, {creation_properties}]);
prompt()
Window.prompt (message, preset[, title ]);
message
The string for the displayed message.
preset
The initial value to be displayed in the text edit field.
title
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.”
Displays a modal dialog that returns the user’s text input.
Returns the value of the text edit field if the user clicked OK,
null if the user clicked Cancel.
type
The window type. The value is:
X dialog — Creates a modal dialog.
X palette — Creates a modeless dialog, also called a floating palette. (Not
supported by Photoshop CS5.)
X window — Creates a simple window that can be used as a main window for
an application. (Not supported by Photoshop CS5.)
This argument can be a ScriptUI resource specification; in this case, all other
arguments are ignored. See “
Resource specifications” on page 78.
title
Optional. The window title. A localizable string.
bounds
Optional. The window’s position and size.
creation_properties
Optional. An object that can contain any of these properties:
X resizeable — When true, the window can be resized by the user. Default
is false.
X su1PanelCoordinates — Photoshop only. When true, the child panels of
this window automatically adjust the positions of their children for
compatability with Photoshop CS (in which the vertical coordinate was
measured from outside the frame). Default is false. Individual panels can
override the parent window’s setting.
X closeButton — When true, the title bar includes a button to close the
window, if the platform and window type allow it. When false, it does not.
Default is true. Not used for dialogs.
Comentarios a estos manuales