// ScriptUI — ScriptUI Classes // Generated from Adobe’s object model export on 2026-09-16. // https://www.indesignjs.de/indesignapi/scriptui/ // // The ScriptUI classes under the names the code uses: new Window(…), // new Button(…). The website appends SUI to tell them apart from the // product classes of the same name; a declaration file has no such // room, so the suffix is gone here. // // Use it INSTEAD OF a product file, not next to one: nine names exist // in both (Window, Button, Event, Events, Group, ListBox, Panel, // RadioButton, StaticText) and TypeScript takes only one meaning per // global name. // // ExtendScript is not a browser. With the DOM library loaded, Document, // Event, Text and Window resolve to the browser versions and everything // below becomes invisible — doc.pages would be unknown, doc.createElement // would not. Put this next to your scripts as jsconfig.json: // // { // "compilerOptions": { "lib": ["es5"], "types": [], "checkJs": false }, // "include": ["**/*.js", "**/*.d.ts"] // } // // The descriptive texts are Adobe’s. Where Adobe’s own type information // is unusable, the type is "any" — see the project README. // // Parameters whose Adobe name is a reserved word carry a trailing // underscore: findKeyStrings(for_), prompt(…, default_, …). // Adobe references these type names without ever defining them. // The name is kept so the intent stays readable; the type is not known. type File = any; /** * Defines the boundaries of a window within the screen’s coordinate space, or * of a UI element within the container’s coordinate space. */ declare class Bounds { /** * The vertical coordinate, a pixel offset from the origin of the element's * coordinate space. */ bottom: number; /** * The height in pixels. */ height: number; /** * The horizontal coordinate, a pixel offset from the origin of the element's * coordinate space. */ left: number; /** * The array length. */ readonly length: number; /** * The width in pixels. */ right: number; /** * The height in pixels. */ top: number; /** * The width in pixels. */ width: number; /** * The horizontal coordinate, a pixel offset from the origin of the element's * coordinate space. */ x: number; /** * The vertical coordinate, a pixel offset from the origin of the element's * coordinate space. */ y: number; } /** * A pushbutton element containing a mouse-sensitive text string. */ declare class Button { /** * True if this element is active. */ active: boolean; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * A number of characters for which to reserve space when calculating the * preferred size of the element. * @remarks Range: 0 to … */ characters: number; /** * An array of child elements. */ readonly children: Object[]; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw() event. */ readonly graphics: ScriptUIGraphics; /** * The help string that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The text justification style. */ justify: string; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the container * (properties used only when the element is created). */ properties: Object; /** * The key sequence that invokes the onShortcutKey() callback for this element * (in Windows only). */ shortcutKey: string; /** * The current dimensions of this element. */ size: Dimension; /** * The text to display, a localizable string. */ text: string; /** * The element type; "button". */ readonly type: string; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Hides this element. */ hide(): void; /** * Sends a notification message, simulating the specified user interaction * event. * @param eventName The name of the control event handler to call. */ notify(eventName?: string): void; /** * An event-handler callback function, called when the element acquires the * keyboard focus. */ onActivate(): void; /** * An event-handler callback function, called when the element has been clicked */ onClick(): void; /** * An event-handler callback function, called when the element loses the * keyboard focus. */ onDeactivate(): void; /** * An event-handler callback function, called when the window is about to be * drawn. */ onDraw(): void; /** * An event-handler callback function, called when the element's shortcutKey * sequence is typed in the active window. */ onShortcutKey(): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * A dual-state control showing a box that has a checkmark when the value is * true, and is empty when the value is false. */ declare class Checkbox { /** * True if this element is active. */ active: boolean; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * A number of characters for which to reserve space when calculating the * preferred size of the element. * @remarks Range: 0 to … */ characters: number; /** * An array of child elements. */ readonly children: Object[]; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw() event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The default text justification style for child text elements. */ justify: string; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the item * (properties used only when the element is created). */ properties: Object; /** * The key sequence that invokes the onShortcutKey() callback for this element * (in Windows only). */ shortcutKey: string; /** * The current dimensions of this element. */ size: Dimension; /** * The text to display, a localizable string. */ text: string; /** * The element type; "checkbox". */ readonly type: string; /** * The selection state of the control. */ value: boolean; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Hides this element. */ hide(): void; /** * Sends a notification message, simulating the specified user interaction * event. * @param eventName The name of the control event handler to call. */ notify(eventName?: string): void; /** * An event-handler callback function, called when the element acquires the * keyboard focus. */ onActivate(): void; /** * An event-handler callback function, called when the element has been * clicked. */ onClick(): void; /** * An event-handler callback function, called when the element loses the * keyboard focus. */ onDeactivate(): void; /** * An event-handler callback function, called when the window is about to be * drawn. */ onDraw(): void; /** * An event-handler callback function, called when the element's shortcutKey * sequence is typed in the active window. */ onShortcutKey(): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * Defines the size of a window or UI element. Contains a 2-element array. */ declare class Dimension { /** * The height in pixels. */ height: number; /** * The array length. */ readonly length: number; /** * The width in pixels. */ width: number; } /** * Describes an input state at the time of the triggering * ScriptUIGraphics.onDraw() event. */ declare class DrawState { /** * True if the Alt key is being pressed (in Windows only). */ readonly altKeyPressed: boolean; /** * True if the Caps Lock key is being pressed. */ readonly capsLockKeyPressed: boolean; /** * True if the Command key is being pressed (in Mac OS only). */ readonly cmdKeyPressed: boolean; /** * True if the Ctrl key is being pressed. */ readonly ctrlKeyPressed: boolean; /** * True if the element has the input focus. */ readonly hasFocus: boolean; /** * True if the left mouse button is being pressed. */ readonly leftButtonPressed: boolean; /** * True if the middle mouse button is being pressed. */ readonly middleButtonPressed: boolean; /** * True if the cursor is hovering over this element. */ readonly mouseOver: boolean; /** * True if the Num Lock key is being pressed. */ readonly numLockKeyPressed: boolean; /** * True if the Option key is being pressed (in Mac OS only). */ readonly optKeyPressed: boolean; /** * True if the right mouse button is being pressed. */ readonly rightButtonPressed: boolean; /** * True if the Shift key is being pressed. */ readonly shiftKeyPressed: boolean; } /** * Displays a single visible item. When you click the control, a list drops * down or pops up, and allows you to select one of the other items in the * list. */ declare class DropDownList { /** * True if this element is active. */ active: boolean; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * An array of child elements. */ readonly children: Object[]; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw() event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The width and height in pixels of each item in the list. */ itemSize: Dimension; /** * The array of choice items displayed in the drop-down or pop-up list. */ readonly items: ListItem[]; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the container * (properties used only when the element is created). */ properties: Object; /** * The currently selected list item. */ selection: ListItem; /** * The key sequence that invokes the onShortcutKey() callback for this element * (in Windows only). */ shortcutKey: string; /** * The current dimensions of this element. */ size: Dimension; /** * The element type; "dropdownlist". */ readonly type: string; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Adds an item or separator to the choices in this list. * @param type The type of the child element. * @param text The localizable text label for the item. */ add(type: string, text?: string): ListItem; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Retrieves an item object from the list that has a given text label. * @param text The text string to match. */ find(text: string): ListItem; /** * Hides this element. */ hide(): void; /** * Sends a notification message, simulating the specified user interaction * event. * @param eventName The name of the control event handler to call. */ notify(eventName?: string): void; /** * An event-handler callback function, called when the element acquires the * keyboard focus. */ onActivate(): void; /** * An event-handler callback function, called when the content of the element * has been changed */ onChange(): void; /** * An event-handler callback function, called when the element loses the * keyboard focus. */ onDeactivate(): void; /** * An event-handler callback function, called when the window is about to be * drawn. */ onDraw(): void; /** * An event-handler callback function, called when the element's shortcutKey * sequence is typed in the active window. */ onShortcutKey(): void; /** * Removes a child item from the list. * @param what The item or child to remove, specified by 0-based index, text value, or as a ListItem object. */ remove(what: any): void; /** * Removes all child items from the list. */ removeAll(): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * An editable text field that the user can select and change. */ declare class EditText { /** * True if this element is active. */ active: boolean; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * A number of characters for which to reserve space when calculating the * preferred size of the element. * @remarks Range: 0 to … */ characters: number; /** * An array of child elements. */ readonly children: Object[]; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw() event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The text justification style. */ justify: string; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the container * (properties used only when the element is created). */ properties: Object; /** * The key sequence that invokes the onShortcutKey() callback for this element * (in Windows only). */ shortcutKey: string; /** * The current dimensions of this element. */ size: Dimension; /** * The current text displayed in the field, a localizable string. */ text: string; /** * The currently selected text, or the empty string if there is no text * selected. */ textselection: string; /** * The element type; "edittext". */ readonly type: string; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Hides this element. */ hide(): void; /** * Sends a notification message, simulating the specified user interaction * event. * @param eventName The name of the control event handler to call. */ notify(eventName?: string): void; /** * An event-handler callback function, called when the element acquires the * keyboard focus. */ onActivate(): void; /** * An event-handler callback function, called when the content of the element * has been changed */ onChange(): void; /** * An event-handler callback function, called when the content of the element * is in the process of changing */ onChanging(): void; /** * An event-handler callback function, called when the element loses the * keyboard focus. */ onDeactivate(): void; /** * An event-handler callback function, called when the window is about to be * drawn. */ onDraw(): void; /** * An event-handler callback function, called when the element's shortcutKey * sequence is typed in the active window. */ onShortcutKey(): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * Defines attributes of the ScriptUI environment. */ declare class Environment { /** * An object that reports the active state of the keyboard at any time. */ readonly keyboardState: KeyboardState; } /** * Base class for UIEvent. */ declare class Event { static readonly AT_TARGET: any; static readonly BUBBLING_PHASE: any; static readonly CAPTURING_PHASE: any; static readonly NOT_DISPATCHING: any; /** * True if the event is of a type that bubbles. */ readonly bubbles: boolean; /** * True if the default action associated with the event can be canceled with * preventDefault(). */ readonly cancelable: boolean; /** * True if this event can be captured. */ readonly captures: boolean; /** * The event target object which is currently handling the event. During * capturing and bubbling, this is different from the property target. */ readonly currentTarget: boolean; /** * The current phase of event propagation; one of none, target, capture, * bubble. */ readonly eventPhase: string; /** * The event target object for this event. */ readonly target: any; /** * The date and time at which the event occurred. */ readonly timeStamp: Date; /** * The name of the event that this object represents. */ readonly type: string; /** * Prevents the default action associated with this event from being called. */ preventDefault(): void; /** * Stops the propagation of this event. */ stopPropagation(): void; } /** * Provides access to objects used in the ScriptUI event system. */ declare class Events { /** * Creates an instance of the specified Event subclass. * @param eventType The name of an event type: one of "UIEvent", "KeyboardEvent", or "MouseEvent". */ createEvent(eventType: string): Event; } /** * A control that contains a Flash Player, which can load and play Flash movies * stored in SWF files. */ declare class FlashPlayer { /** * True if this element is active. */ active: boolean; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * True if this element is enabled. */ enabled: boolean; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the container * (properties used only when the element is created). */ properties: Object; /** * The current dimensions of this element. */ size: Dimension; /** * The element type, "flashplayer". */ readonly type: string; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * A function definition for a callback from the Flash ActionScript * environment. */ callback(): void; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Hides this element. */ hide(): void; /** * Invokes an ActionScript function defined in the Flash application. * @param name The name of a Flash ActionScript function that has been registered with the ExternalInterface object by the currently loaded SWF file. * @param argument An argument to pass through to the function. */ invokePlayerFunction(name: string, argument?: any): any; /** * Loads a movie into the Flash Player, and begins playing it. * @param file The File object for the SWF file to load. */ loadMovie(file: File): void; /** * Sends a notification message, simulating the specified user interaction * event. * @param eventName The name of the control event handler to call. */ notify(eventName?: string): void; /** * Restarts a movie that has been stopped. * @param rewind When true, restarts the movie from the beginning; otherwise, starts playing from the point where it was stopped. */ playMovie(rewind: boolean): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; /** * Halts playback of the current movie. */ stopMovie(): void; } /** * A container for other controls within a window. */ declare class Group { /** * Tells the layout manager how unlike-sized children of this container should * be aligned within a column or row. */ alignChildren: string; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * An array of child elements. */ readonly children: Object[]; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw() event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The layout manager for this container. */ layout: LayoutManager; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The number of pixels between the edges of a container and the outermost * child elements. */ margins: number; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The layout orientation of children in a container. */ orientation: string; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the control * (properties used only when the element is created). */ properties: Object; /** * The current dimensions of this element. */ size: Dimension; /** * The number of pixels separating one child element from its adjacent sibling * element. */ spacing: number; /** * The element type; "group". */ readonly type: string; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Adds a child element to this container. * @param type The type of the child element, as specified for the type property. * @param bounds A bounds specification that describes the size and position of the new control or container, relative to its parent. * @param text The text or label, a localizable string. * @param properties An object that contains one or more creation properties of the new child (properties used only when the element is created). */ add(type: string, bounds?: Bounds, text?: string, properties?: Object): any; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Hides this element. */ hide(): void; /** * An event-handler callback function, called when the group is about to be * drawn. */ onDraw(): void; /** * Removes the specified child control from this group's children array. * @param what The child control to remove, specified by 0-based index, text property value, or as a control object. */ remove(what: any): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * A mouse-sensitive pushbutton that displays an image instead of text. */ declare class IconButton { /** * True if this element is active. */ active: boolean; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * An array of child elements. */ readonly children: Object[]; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw() event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The image object that defines the image to be drawn. */ image: ScriptUIImage; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the container * (properties used only when the element is created). */ properties: Object; /** * The key sequence that invokes the onShortcutKey() callback for this element * (in Windows only). */ shortcutKey: string; /** * The current dimensions of this element. */ size: Dimension; /** * The element type; "iconbutton". */ readonly type: string; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Hides this element. */ hide(): void; /** * Sends a notification message, simulating the specified user interaction * event. * @param eventName The name of the control event handler to call. */ notify(eventName?: string): void; /** * An event-handler callback function, called when the element acquires the * keyboard focus. */ onActivate(): void; /** * An event-handler callback function, called when the element has been * clicked. */ onClick(): void; /** * An event-handler callback function, called when the element loses the * keyboard focus. */ onDeactivate(): void; /** * An event-handler callback function, called when the window is about to be * drawn. */ onDraw(): void; /** * An event-handler callback function, called when the element's shortcutKey * sequence is typed in the active window. */ onShortcutKey(): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * Reports the active state of the keyboard. */ declare class KeyboardState { /** * True if the Alt or Option key is pressed. */ readonly altKey: boolean; /** * True if the Ctrl key is pressed. */ readonly ctrlKey: boolean; /** * A string containing the name of the currently pressed key, such as "a", or * an empty string. */ readonly keyName: string; /** * True if the Cmd key (in Mac OS) or Windows key (in Windows) is pressed. */ readonly metaKey: boolean; /** * True if the Shift key is pressed. */ readonly shiftKey: boolean; } /** * Controls the automatic layout behavior for a window or container. */ declare class LayoutManager { /** * Invokes the automatic layout behavior for the managed container. */ layout(): void; /** * Performs a layout after a Window is resized, based on the new size. */ resize(): void; } /** * Displays a list of choices, represented by ListItem objects. */ declare class ListBox { /** * True if this element is active. */ active: boolean; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * An array of child ListItem elements. */ readonly children: Object[]; /** * For a multi-column list box, the column properties. */ readonly columns: any; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw() event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The width and height in pixels of each item in the list. */ itemSize: Dimension; /** * The array of choice items displayed in the list. */ readonly items: ListItem[]; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the control * (properties used only when the element is created). */ properties: Object; /** * The currently selected item for a single-selection list, or an array of * items for current selection in a multi-selection list. */ selection: ListItem; /** * The key sequence that invokes the onShortcutKey() callback for this element * (in Windows only). */ shortcutKey: string; /** * The current dimensions of this element. */ size: Dimension; /** * The element type; "listbox". */ readonly type: string; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Adds an item to the choices in this list. * @param type The type of the child element, the string "item". * @param text The localizable text label for the item. */ add(type: string, text?: string): ListItem; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Retrieves an item object from the list that has a given text label. * @param text The text string to match. */ find(text: string): ListItem; /** * Hides this element. */ hide(): void; /** * Sends a notification message, simulating the specified user interaction * event. * @param eventName The name of the control event handler to call. */ notify(eventName?: string): void; /** * An event-handler callback function, called when the element acquires the * keyboard focus. */ onActivate(): void; /** * An event-handler callback function, called when the content of the element * has been changed */ onChange(): void; /** * An event-handler callback function, called when the element loses the * keyboard focus. */ onDeactivate(): void; /** * An event-handler callback function, called when an item in the listbox is * double-clicked */ onDoubleClick(): void; /** * An event-handler callback function, called when the window is about to be * drawn. */ onDraw(): void; /** * An event-handler callback function, called when the element's shortcutKey * sequence is typed in the active window. */ onShortcutKey(): void; /** * Removes a child item from the list. * @param what The item or child to remove, specified by 0-based index, text value, or as a ListItem object. */ remove(what: any): void; /** * Removes all child items from the list. */ removeAll(): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * An item in a list box, drop-down list, or tree view. */ declare class ListItem { /** * The checked state of an item in a list. */ checked: boolean; /** * The expansion state of an item of type node that is a child of a TreeView * list control. */ expanded: boolean; /** * An image object for an icon to display in the item. */ image: ScriptUIImage; /** * The 0-based index of this item in the items collection of its parent list * control. */ readonly index: number; /** * The parent element, a list control. */ readonly parent: any; /** * An object that contains one or more creation properties of the item * (properties used only when the element is created). */ properties: Object; /** * The selection state of this item. */ selected: boolean; /** * When the parent is a multi-column ListBox, this describes the labels for * this selectable row in additional columns. */ readonly subItems: any[]; /** * The label text to display for the item, a localizable string. */ text: string; /** * The element type. */ readonly type: string; } /** * A container for other types of controls, with an optional frame. */ declare class Panel { /** * Specifies how to align the child elements. */ alignChildren: string; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * Reserve space for the specified number of characters; affects calculation of * preferredSize . * @remarks Range: 0 to … */ characters: number; /** * An array of child elements. */ readonly children: Object[]; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw() event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The default text justification style for child text elements. */ justify: string; /** * The layout manager for this container. */ layout: LayoutManager; /** * The upper left corner of this element's frame relative to its parent. */ location: Point; /** * The number of pixels between the edges of a container and the outermost * child elements. */ margins: number; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The layout orientation of children in a container. */ orientation: string; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the control * (properties used only when the element is created). */ properties: Object; /** * The current dimensions of this element. */ size: Dimension; /** * The number of pixels separating one child element from its adjacent sibling * element. */ spacing: number; /** * The title or label text, a localizable string. */ text: string; /** * The element type; "panel". */ readonly type: string; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Adds a child element to this container. * @param type The type of the child element, as specified for the type property. * @param bounds A bounds specification that describes the size and position of the new control or container, relative to its parent. * @param text The text or label, a localizable string. * @param properties An object that contains one or more creation properties of the new child (properties used only when the element is created). */ add(type: string, bounds?: Bounds, text?: string, properties?: Object): any; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Hides this element. */ hide(): void; /** * An event-handler callback function, called when the panel is about to be * drawn. */ onDraw(): void; /** * Removes the specified child control from this group's children array. * @param what The child control to remove, specified by 0-based index, text property value, or as a control object. */ remove(what: any): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * Defines the location of a window or UI element. Contains a 2-element array. */ declare class Point { /** * The left coordinate. */ left: number; /** * The array length. */ readonly length: number; /** * The top coordinate. */ top: number; /** * The horizontal coordinate, a pixel offset from the origin of the element's * coordinate space. */ x: number; /** * The vertical coordinate, a pixel offset from the origin of the element's * coordinate space. */ y: number; } /** * A horizontal bar with an indicator that shows the progress of an operation. */ declare class Progressbar { /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * An array of child elements. */ readonly children: Object[]; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw() event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The maximum value in the range. Default is 100. */ maxvalue: number; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The minimum value in the range; always 0. If set to a different value, it is * ignored. */ minvalue: number; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the container * (properties used only when the element is created). */ properties: Object; /** * The current dimensions of this element. */ size: Dimension; /** * The element type, "progessbar". */ readonly type: string; /** * The current position of the indicator. */ value: number; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Hides this element. */ hide(): void; /** * An event-handler callback function, called when the window is about to be * drawn. */ onDraw(): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * A dual-state control, grouped with other radiobuttons, of which only one can * be in the selected state. */ declare class RadioButton { /** * True if this element is active. */ active: boolean; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * A number of characters for which to reserve space when calculating the * preferred size of the element. * @remarks Range: 0 to … */ characters: number; /** * An array of child elements. */ readonly children: Object[]; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The default text justification style for child text elements. */ justify: string; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the container * (properties used only when the element is created). */ properties: Object; /** * The key sequence that invokes the onShortcutKey() callback for this element * (in Windows only). */ shortcutKey: string; /** * The current dimensions of this element. */ size: Dimension; /** * The label text for this button, a localizable string. */ text: string; /** * The element type; "radiobutton". */ readonly type: string; /** * The selection state of this button, selected when true. */ value: boolean; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Hides this element. */ hide(): void; /** * Sends a notification message, simulating the specified user interaction * event. * @param eventName The name of the control event handler to call. */ notify(eventName?: string): void; /** * An event-handler callback function, called when the element acquires the * keyboard focus. */ onActivate(): void; /** * An event-handler callback function, called when the element has been * clicked. */ onClick(): void; /** * An event-handler callback function, called when the element loses the * keyboard focus. */ onDeactivate(): void; /** * An event-handler callback function, called when the window is about to be * drawn. */ onDraw(): void; /** * An event-handler callback function, called when the element's shortcutKey * sequence is typed in the active window. */ onShortcutKey(): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * A global class containing central information about ScriptUI. Not * instantiable. */ declare class ScriptUI { /** * Collects the enumerated values that can be used in the alignment and * alignChildren properties of controls and containers. */ static readonly Alignment: string; /** * Collects the enumerated values that can be used as the style argument to the * ScriptUI.newFont() method. */ static readonly FontStyle: any; /** * The font constants defined by the host application. */ static readonly applicationFonts: any; /** * An object whose properties are the names of compatability modes supported by * the host application. */ static readonly compatibility: any; /** * A string containing the internal version number of the ScriptUI module. */ static readonly coreVersion: string; /** * An object whose properties define attributes of the environment in which * ScriptUI operates. */ static readonly environment: Environment; /** * An object whose properties and methods provide access to objects used in the * ScriptUI event system. */ static readonly events: Events; /** * A string containing the name of the UI component framework with which this * version of ScriptUI is compatible. */ static readonly frameworkName: string; /** * A string containing the version number of the ScriptUI component framework */ static readonly version: any; /** * Finds and returns the resource for a given text string from the host * application's resource data. * @param text The text to match. */ static getResourceText(text: string): string; /** * Creates a new font object for use in text controls and titles. * @param name The font name, or the font family name. * @param style The font style; can be string, or one of the values of ScriptUI.FontStyle. * @param size The font size in points. */ static newFont(name: string, style: string | number, size: number): ScriptUIFont; /** * Loads a new image from resources or disk files into an image object. * @param normal The resource name or the disk file path to the image used for the normal state. * @param disabled The resource name, or the disk file path to the image used for the disabled state. * @param pressed The resource name, or the file-system path to the image used for the pressed state. * @param rollover The resource name, or the file-system path to the image used for the rollover state. */ static newImage(normal: string, disabled?: string, pressed?: string, rollover?: string): ScriptUIImage; } /** * A painting brush that encapsulates a color or pattern used to fill paths. */ declare class ScriptUIBrush { /** * The brush color. */ readonly color: number[]; /** * The theme name. */ readonly theme: string; /** * The brush type, solid or theme. */ readonly type: number; } /** * Encapsulates the qualities of a font used to draw text into a control. */ declare class ScriptUIFont { /** * The font family name. */ readonly family: string; /** * The complete font name, consisting of the family and style, if specified. */ readonly name: string; /** * The font point size. */ readonly size: number; /** * The font style. One of the constants in ScriptUIGraphics.FontStyle. */ readonly style: any; /** * The name of a substitution font, a fallback font to substitute for this font * if the requested font family or style is not available. */ readonly substitute: string; } /** * An object used to draw custom graphics, found in the graphics property of * window, container, and control objects. */ declare class ScriptUIGraphics { /** * Contains the enumerated constants for the type argument of newBrush(). */ static readonly BrushType: any; /** * Contains the enumerated constants for the type argument of newPen(). */ static readonly PenType: any; /** * The background color for containers; for non-containers, the parent * background color. */ backgroundColor: ScriptUIBrush; /** * The current drawing path, encapsulated in a path object. */ readonly currentPath: ScriptUIPath; /** * The current position in the current drawing path. */ readonly currentPoint: Point; /** * The background color for containers when disabled or inactive; for * non-containers, the parent background color. */ disabledBackgroundColor: ScriptUIBrush; /** * The text color when the element is disabled or inactive. */ disabledForegroundColor: ScriptUIPen; /** * The default font to use for displaying text. */ font: ScriptUIFont; /** * The text color. */ foregroundColor: ScriptUIPen; /** * Closes the current path. */ closePath(): void; /** * Draws a focus ring within a region of this element. * @param left The left coordinate of the region. * @param top The top coordinate of the region. * @param width The width of the region in pixels. * @param height The height of the region in pixels. */ drawFocusRing(left: number, top: number, width: number, height: number): void; /** * Draws an image within a given region of the element. * @param image The image to draw. * @param left The left coordinate of the region, relative to the origin of this element. * @param top The top coordinate of the region, relative to the origin of this element. * @param width The width in pixels. If provided, the image is stretched or shrunk to fit. If omitted, uses the original image width. * @param height The height in pixels. If provided, the image is stretched or shrunk to fit. If omitted, uses the original image height. */ drawImage(image: ScriptUIImage, left: number, top: number, width?: number, height?: number): void; /** * Draw the platform-specific control associated with this element. */ drawOSControl(): void; /** * Draw a string of text starting at a given point in this element, using a * given drawing pen and font. * @param text The text string. * @param pen The drawing pen to use. * @param x The left coordinate, relative to the origin of this element. * @param y The top coordinate, relative to the origin of this element. * @param font The font to use. Default is the font value in this object. */ drawString(text: string, pen: ScriptUIPen, x: number, y: number, font?: ScriptUIFont): void; /** * Defines an elliptical path within a given rectangular area in the * currentPath object, which can be filled using fillPath() or stroked using * strokePath(). * @param left The left coordinate of the region, relative to the origin of this element. * @param top The top coordinate of the region, relative to the origin of this element. * @param width The width of the region in pixels. * @param height The height of the region in pixels. */ ellipsePath(left: number, top: number, width: number, height: number): Point; /** * Fills a path using a given painting brush. * @param brush The brush object that defines the fill color. * @param path The path object. Default is the currentPath. */ fillPath(brush: ScriptUIBrush, path?: ScriptUIPath): void; /** * Adds a path segment to the currentPath. * @param x The X coordinate for the destination point, relative to the origin of this element. * @param y The Y coordinate for the destination point, relative to the origin of this element. */ lineTo(x: number, y: number): Point; /** * Calculates the size needed to display a string using the given font. * @param text The text string to measure. * @param font The font to use. Default is the font value in this object. * @param boundingWidth The bounding width. */ measureString(text: string, font?: ScriptUIFont, boundingWidth?: number): Dimension; /** * Adds a given point to the currentPath, and makes it the current drawing * position. * @param x The X coordinate for the new point, relative to the origin of this element. * @param y The Y coordinate for the new point, relative to the origin of this element. */ moveTo(x: number, y: number): Point; /** * Creates a new painting brush object. * @param type The brush type, solid or theme. * @param color The brush color. */ newBrush(type: number, color: (number | string)[]): ScriptUIBrush; /** * Creates a new, empty path object. */ newPath(): ScriptUIPath; /** * Creates a new drawing pen object. * @param type The pen type, solid or theme. * @param color The pen color. * @param width The width of the pen line in pixels. */ newPen(type: number, color: (number | string)[], width: number): ScriptUIPen; /** * Defines a rectangular path in the currentPath object. * @param left The left coordinate relative to the origin of this element. * @param top The top coordinate relative to the origin of this element. * @param width The width in pixels. * @param height The height in pixels. */ rectPath(left: number, top: number, width: number, height: number): Point; /** * Strokes the path segments of a path with a given drawing pen. * @param pen The drawing pen that defines the color and line width. * @param path The path object. Default is the currentPath. */ strokePath(pen: ScriptUIPen, path?: ScriptUIPath): void; } /** * Encapsulates a set of images that can be drawn into a control. */ declare class ScriptUIImage { /** * The image format. One of: resource, JPEG, GIF, TIFF, PNG, or PICT * (Macintosh). */ readonly format: string; /** * The image name. Either the file name, or the resource name. */ readonly name: string; /** * The full path to the file that contains the image. */ readonly pathname: string; /** * The image size in pixels. */ readonly size: Dimension; } /** * A helper object that encapsulates a drawing path for a figure to be drawn * into a window or control. */ declare class ScriptUIPath { } /** * A drawing pen that defines a color and line width used to stroke paths. */ declare class ScriptUIPen { /** * The pen color. */ readonly color: number[]; /** * The pixel width of the drawing line. * @remarks Range: 1 to … */ lineWidth: number; /** * The theme name. */ readonly theme: string; /** * The pen type, solid or theme. */ readonly type: string; } /** * A scrollbar with a draggable scroll indicator and stepper buttons to move * the indicator. */ declare class Scrollbar { /** * True if this element is active. */ active: boolean; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * An array of child elements. */ readonly children: Object[]; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw() event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The amount to increment or decrement a scrollbar indicator's position when * the user clicks ahead or behind the moveable element. * @remarks Range: 0 to … */ jumpdelta: number; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The maximum value allowed in the value property. */ maxvalue: number; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The minimum value allowed in the value property. */ minvalue: number; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the container * (properties used only when the element is created). */ properties: Object; /** * The key sequence that invokes the onShortcutKey() callback for this element * (in Windows only). */ shortcutKey: string; /** * The current dimensions of this element. */ size: Dimension; /** * The amount by which to increment or decrement a scrollbar element's position * when the user clicks a stepper button. * @remarks Range: 0 to … */ stepdelta: number; /** * The element type, "scrollbar". */ readonly type: string; /** * The current position of the indicator. */ value: number; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Hides this element. */ hide(): void; /** * Sends a notification message, simulating the specified user interaction * event. * @param eventName The name of the control event handler to call. */ notify(eventName?: string): void; /** * An event-handler callback function, called when the element acquires the * keyboard focus. */ onActivate(): void; /** * An event-handler callback function, called when the user has finished * dragging the position indicator, or has clicked the control. */ onChange(): void; /** * An event-handler callback function, called when the content of the element * is in the process of changing */ onChanging(): void; /** * An event-handler callback function, called when the element loses the * keyboard focus. */ onDeactivate(): void; /** * An event-handler callback function, called when the window is about to be * drawn. */ onDraw(): void; /** * An event-handler callback function, called when the element's shortcutKey * sequence is typed in the active window. */ onShortcutKey(): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * A slider bar that indicates a numeric value with a moveable position * indicator. */ declare class Slider { /** * True if this element is active. */ active: boolean; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * An array of child elements. */ readonly children: Object[]; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw() event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The maximum value allowed in the value property. */ maxvalue: number; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The minimum value allowed in the value property. */ minvalue: number; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the container * (properties used only when the element is created). */ properties: Object; /** * The key sequence that invokes the onShortcutKey() callback for this element * (in Windows only). */ shortcutKey: string; /** * The current dimensions of this element. */ size: Dimension; /** * The element type, "slider". */ readonly type: string; /** * The current position of the indicator. */ value: number; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Hides this element. */ hide(): void; /** * Sends a notification message, simulating the specified user interaction * event. * @param eventName The name of the control event handler to call. */ notify(eventName?: string): void; /** * An event-handler callback function, called when the element acquires the * keyboard focus. */ onActivate(): void; /** * An event-handler callback function, called when the user has finished * dragging the position indicator, or has clicked the control. */ onChange(): void; /** * An event-handler callback function, called when the content of the element * is in the process of changing */ onChanging(): void; /** * An event-handler callback function, called when the element loses the * keyboard focus. */ onDeactivate(): void; /** * An event-handler callback function, called when the window is about to be * drawn. */ onDraw(): void; /** * An event-handler callback function, called when the element's shortcutKey * sequence is typed in the active window. */ onShortcutKey(): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * A text label that the user cannot change. */ declare class StaticText { /** * Always false. This element cannot have input focus. */ active: boolean; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * A number of characters for which to reserve space when calculating the * preferred size of the element. * @remarks Range: 0 to … */ characters: number; /** * An array of child elements. */ readonly children: Object[]; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw() event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The text justification style. */ justify: string; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the container * (properties used only when the element is created). */ properties: Object; /** * The key sequence that invokes the onShortcutKey() callback for this element * (in Windows only). */ shortcutKey: string; /** * The current dimensions of this element. */ size: Dimension; /** * The text to display, a localizable string. */ text: string; /** * The element type, "statictext". */ readonly type: string; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Hides this element. */ hide(): void; /** * Sends a notification message, simulating the specified user interaction * event. * @param eventName The name of the control event handler to call. */ notify(eventName?: string): void; /** * An event-handler callback function, called when the window is about to be * drawn. */ onDraw(): void; /** * An event-handler callback function, called when the element's shortcutKey * sequence is typed in the active window. */ onShortcutKey(): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * A hierarchical list whose items can contain child items. */ declare class TreeView { /** * True if this element is active. */ active: boolean; /** * The alignment style for this element. If defined, this value overrides the * alignChildren setting for the parent container. */ alignment: string; /** * The boundaries of the element, in parent-relative coordinates. */ bounds: Bounds; /** * An array of child elements. */ readonly children: Object[]; /** * True if this element is enabled. */ enabled: boolean; /** * The graphics object that can be used to customize the element's appearance, * in response to the onDraw() event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element during automatic layout. * @remarks Range: 0 to … */ indent: number; /** * The width and height in pixels of each item in the list. */ itemSize: Dimension; /** * The array of top-level items displayed in the list. */ readonly items: ListItem[]; /** * The upper left corner of this element relative to its parent. */ location: Point; /** * The maximum height and width to which the element can be resized. */ maximumSize: Dimension; /** * The minimum height and width to which the element can be resized. */ minimumSize: Dimension; /** * The parent element. */ readonly parent: any; /** * The preferred size, used by layout managers to determine the best size for * each element. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the control * (properties used only when the element is created). */ properties: Object; /** * The currently selected list item. */ selection: ListItem; /** * The key sequence that invokes the onShortcutKey() callback for this element * (in Windows only). */ shortcutKey: string; /** * The current dimensions of this element. */ size: Dimension; /** * The element type, "treeview". */ readonly type: string; /** * True if this element is shown, false if it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this element relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Adds an item to the top-level choices in this list. * @param type The type of the child element, the string "item". * @param text The localizable text label for the item. */ add(type: string, text?: string): ListItem; /** * Registers an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): Event; /** * Retrieves an item object from the list that has a given text label. * @param text The text string to match. */ find(text: string): ListItem; /** * Hides this element. */ hide(): void; /** * Sends a notification message, simulating the specified user interaction * event. * @param eventName The name of the control event handler to call. */ notify(eventName?: string): void; /** * An event-handler callback function, called when the element acquires the * keyboard focus. */ onActivate(): void; /** * An event-handler callback function, called when the content of the element * has been changed */ onChange(): void; /** * An event-handler callback function, called when the user collapses (closes) * an expanded node in the treeview. * @param item The ListItem node that collapsed. */ onCollapse(item: ListItem): void; /** * An event-handler callback function, called when the element loses the * keyboard focus. */ onDeactivate(): void; /** * An event-handler callback function, called when the window is about to be * drawn. */ onDraw(): void; /** * An event-handler callback function, called when the user expands (opens) a * collapsed node in the treeview. * @param item The ListItem node that expanded. */ onExpand(item: ListItem): void; /** * An event-handler callback function, called when the element's shortcutKey * sequence is typed in the active window. */ onShortcutKey(): void; /** * Removes a child item from the list. * @param what The item or child to remove, specified by 0-based index in the top-level item list, text value, or as a ListItem object. */ remove(what: any): void; /** * Removes all child items from the list. */ removeAll(): void; /** * Unregisters an event handler for a particular type of event occuring in this * element. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Shows this element. */ show(): any; } /** * Encapsulates input event information for an event that propagates through a * container and control hierarchy. */ declare class UIEvent { /** * True if the event is of a type that bubbles. */ readonly bubbles: boolean; /** * True if the default action associated with the event can be canceled with * preventDefault(). */ readonly cancelable: boolean; /** * True if this event can be captured. */ readonly captures: boolean; /** * The event target object which is currently handling the event. During * capturing and bubbling, this is different from the property target. */ readonly currentTarget: boolean; /** * The click count for a mouse-click event. */ readonly detail: any; /** * The current phase of event propagation; one of none, target, capture, * bubble. */ readonly eventPhase: string; /** * The event target object for this event. */ readonly target: any; /** * The date and time at which the event occurred. */ readonly timeStamp: Date; /** * The name of the event that this object represents. */ readonly type: string; /** * The ScriptUI element that this event relates to. */ readonly view: any; /** * Creates an event. * @param type The event type. See UIEvent.type property. * @param captures Set to true if this event can be captured. * @param bubbles Set to true if the event bubbles. * @param view The ScriptUI element that this event relates to. * @param detail The click count for a mouse-click event. */ constructor(type: string, captures: boolean, bubbles: boolean, view?: Object, detail?: number); /** * Initializes a UI event as a core W3C event. * @param type The event type. * @param captures Set to true if this event can be captured. * @param bubbles Set to true if the event bubbles. * @param cancelable Set to true if the default action is cancelable. */ initEvent(type: string, captures: boolean, bubbles: boolean, cancelable: boolean): void; /** * Initializes an event. * @param type The event type. * @param captures Set to true if this event can be captured. * @param bubbles Set to true if the event bubbles. * @param view The ScriptUI element that this event relates to. * @param detail The click count for a mouse-click event. */ initUIEvent(type: string, captures: boolean, bubbles: boolean, view?: Object, detail?: number): void; /** * Prevents the default action associated with this event from being called. */ preventDefault(): void; /** * Stops the propagation of this event. */ stopPropagation(): void; } /** * The instance represents a top-level window or dialog box, which contains * user-interface elements. */ declare class Window { /** * Set to true to make this window active. */ active: boolean; /** * Tells the layout manager how unlike-sized children of this container should * be aligned within a column or row. */ alignChildren: string; /** * The alignment style for child elements of a container. If defined, this * value overrides the alignChildren setting for the parent container. */ alignment: string; /** * The bounds of the window's drawable area, excluding the frame, in screen * coordinates. */ bounds: Bounds; /** * For windows of type dialog, the UI element to notify when the user presses a * cancellation key combination. */ cancelElement: Object; /** * A number of characters for which to reserve space when calculating the * preferred size of the window. * @remarks Range: 0 to … */ characters: number; /** * The collection of UI elements that have been added to this container. */ readonly children: Object[]; /** * For windows of type dialog, the UI element to notify when the user presses a * Enter key. */ defaultElement: Object; /** * True if this element is enabled. */ enabled: boolean; /** * The bounds of the window frame in screen coordinates. */ readonly frameBounds: Bounds; /** * The top left corner of the window frame in screen coordinates. */ frameLocation: Point; /** * The size and location of the window's frame in screen coordinates. */ readonly frameSize: Dimension; /** * Deprecated. Use ScriptUI.frameworkName instead. */ static readonly frameworkName: string; /** * The graphics object that can be used to customize the window’s appearance, * in response to the onDraw event. */ readonly graphics: ScriptUIGraphics; /** * The help text that is displayed when the mouse hovers over the element. */ helpTip: string; /** * The number of pixels to indent the element. * @remarks Range: 0 to … */ indent: number; /** * The default text justification style for child text elements. */ justify: string; /** * The layout manager for this container. */ layout: LayoutManager; /** * The upper left corner of the window's drawable area. */ location: Point; /** * The number of pixels between the edges of a container and the outermost * child elements. */ margins: number; /** * True if the window is expanded. */ maximized: boolean; /** * The largest rectangle to which the window can be resized. */ maximumSize: Dimension; /** * True if the window is minimized or iconified. */ minimized: boolean; /** * The smallest rectangle to which the window can be resized. */ minimumSize: Dimension; /** * The opacity of the window, in the range [0..1]. */ opacity: number; /** * The layout orientation of children in a container. */ orientation: string; /** * The immediate parent element. */ readonly parent: any; /** * The preferred size of the window. */ preferredSize: Dimension; /** * An object that contains one or more creation properties of the container * (properties used only when the element is created). */ properties: Object; /** * The keypress combination that invokes this element's onShortcutKey() * callback. */ shortcutKey: string; /** * The current size and location of the content area of the window in screen * coordinates. */ size: Dimension; /** * The number of pixels separating one child element from its adjacent sibling * element. */ spacing: number; /** * The title, label, or displayed text, a localizeable string. */ text: string; /** * The element type; "dialog", "palette", or "window". */ readonly type: string; /** * Deprecated. Use ScriptUI.version instead. */ static readonly version: any; /** * When true, the element is shown, when false it is hidden. */ visible: boolean; /** * The window that this element belongs to. */ readonly window: Window; /** * The bounds of this window relative to the top-level parent window. */ readonly windowBounds: Bounds; /** * Creates a new window. * @param type The window type. * @param title The window title, a localizable string. * @param bounds The window's position and size. * @param properties An object containing creation-only properties. */ constructor(type: string, title?: string, bounds?: Bounds, properties?: Object); /** * Creates and returns a new control or container object and adds it to the * children of this window. * @param type The type of the child element, as specified for the type property. * @param bounds A bounds specification that describes the size and position of the new control or container, relative to its parent. * @param text The text or label, a localizable string. * @param properties An object that contains one or more creation properties of the new child (properties used only when the element is created). */ add(type: string, bounds?: Bounds, text?: string, properties?: Object): any; /** * Registers an event handler for a particular type of event occuring in this * window. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase When true, the handler is called only in the capturing phase of the event propagation. */ addEventListener(eventName: string, handler: Function, capturePhase?: boolean): boolean; /** * Displays a platform-standard dialog containing a short message and an OK * button. * @param message TThe string for the displayed message. * @param title A string to appear as the title of the dialog, if the platform supports a title. * @param errorIcon When true, the platform-standard alert icon is replaced by the platform-standard error icon in the dialog. */ alert(message: string, title?: string, errorIcon?: boolean): void; /** * Centers this window on screen or with repect to another window. * @param window The relative window. If not specified, centers on the screen. */ center(window?: Window): void; /** * Closes this window. * @param return_ A number to be returned from the show() method that invoked this window as a modal dialog. */ close(return_?: any): void; /** * Displays a platform-standard dialog containing a short message and two * buttons labeled Yes and No. * @param message The string for the displayed message. * @param noAsDefault When true, the No button is the default choice, selected when the user types Enter. * @param title A string to appear as the title of the dialog, if the platform supports a title. */ confirm(message: string, noAsDefault: boolean, title?: string): boolean; /** * Simulates the occurrence of an event in this target. */ dispatchEvent(): UIEvent; /** * Use this method to find an existing window. * @param type The name of a predefined resource available to JavaScript in the current application; or the window type. * @param title The window title. */ find(type: string, title: string): Window; /** * Hides this windows. */ hide(): void; /** * Sends a notification message to all listeners, simulating the specified user * interaction event. * @param eventName The event name; if omitted, the default event is sent. */ notify(eventName?: string): void; /** * An event-handler callback function, called when the window acquires the * keyboard focus. */ onActivate(): void; /** * An event-handler callback function, called when the window is about to be * closed. */ onClose(): boolean; /** * An event-handler callback function, called when the window loses the * keyboard focus. */ onDeactivate(): void; /** * An event-handler callback function, called when the window has been moved */ onMove(): void; /** * An event-handler callback function, called when the window is being moved */ onMoving(): void; /** * An event-handler callback function, called after the window has been resized */ onResize(): void; /** * An event-handler callback function, called while a window is being resized */ onResizing(): void; /** * In Windows only, an event-handler callback function, called a shortcut-key * sequence is typed that matches the shortcutKey value for this window. */ onShortcutKey(): void; /** * An event-handler callback function, called just before the window is * displayed */ onShow(): void; /** * Displays a modal dialog that returns the user’s text input. * @param prompt The string for the displayed message. * @param default_ The initial value to be displayed in the text edit field. * @param title A string to appear as the title of the dialog. */ prompt(prompt: string, default_?: string, title?: string): string; /** * Removes the specified child control from this window’s children array. * @param what The child control to remove, specified by 0-based index, text property value, or as a control object. */ remove(what: any): void; /** * Unregisters an event handler for a particular type of event occuring in this * window. * @param eventName The name of the event. * @param handler The function that handles the event. * @param capturePhase Whether to call the handler only in the capturing phase of the event propagation. */ removeEventListener(eventName: string, handler: Function, capturePhase: boolean): boolean; /** * Makes this window visible. */ show(): any; }