scriptui-class
ScriptUI class
Section titled “ScriptUI class”The globally available ScriptUI class provides central information about the ScriptUI module. This object is not instantiable.
ScriptUI Classs Attributes
Section titled “ScriptUI Classs Attributes”ScriptUI.Alignment
Section titled “ScriptUI.Alignment”ScriptUI.Alignment
Collects the enumerated values that can be used in the alignment and alignChildren properties of controls and containers, and in the alignment property used to set a control’s titleLayout property.
Use these constants to set the alignment.
When you query the alignment property, it returns index values that correspond to the constants as shown. Constant values are:
ScriptUI.Alignment.TOP
(1)ScriptUI.Alignment.BOTTOM
(2)ScriptUI.Alignment.LEFT
(3)ScriptUI.Alignment.RIGHT
(4)ScriptUI.Alignment.FILL
(5)ScriptUI.Alignment.CENTER
(6)
Object. Read only.
Example
Section titled “Example”myGroup.alignment = [ScriptUI.Alignment.LEFT, ScriptUI.Alignment.TOP]
ScriptUI.applicationFonts
Section titled “ScriptUI.applicationFonts”ScriptUI.applicationFonts
Description
Section titled “Description”Collects the enumerated values that specify the default application fonts.
The available fonts vary according to the application and system configuration.
Object
ScriptUI.compatability
Section titled “ScriptUI.compatability”ScriptUI.compatability
Description
Section titled “Description”An object whose properties are the names of compatibility modes supported by the host application. For example, the presence of ScriptUI.compatability.su1PanelCoordinates
means that the application allows backward compatibility with the coordinate system of Panel elements in ScriptUI version 1.
Object
ScriptUI.coreVersion
Section titled “ScriptUI.coreVersion”ScriptUI.coreVersion
Description
Section titled “Description”The internal core version number of the ScriptUI components.
String. Read only.
ScriptUI.environment
Section titled “ScriptUI.environment”ScriptUI.environment
Description
Section titled “Description”A JavaScript object that provides access to attributes of the ScriptUI environment; contains a Keyboard state object that reports the active state of the keyboard at any time, independent of the event-handling framework.
ScriptUI.events
Section titled “ScriptUI.events”ScriptUI.events
Description
Section titled “Description”A JavaScript object that contains one function, ScriptUI.events.createEvent(), which allows you to create event objects in order to simulate user-interaction events.
Object
ScriptUI.FontStyle
Section titled “ScriptUI.FontStyle”ScriptUI.FontStyle
Description
Section titled “Description”Collects the enumerated values that can be used as the style argument to the ScriptUI.newFont() method. For example:
var font = ScriptUI.newFont( "Helvetica", ScriptUI.FontStyle.BOLD )
Values are:
REGULAR
BOLD
ITALIC
BOLDITALIC
String. Read only.
ScriptUI.frameworkName
Section titled “ScriptUI.frameworkName”ScriptUI.frameworkName
Description
Section titled “Description”The name of the user-interface framework with which this ScriptUI component is compatible.
String. Read only.
ScriptUI.version
Section titled “ScriptUI.version”ScriptUI.version
Description
Section titled “Description”The main version number of the ScriptUI component framework.
String. Read only.
ScriptUI Class Methods
Section titled “ScriptUI Class Methods”ScriptUI.events.createEvent()
Section titled “ScriptUI.events.createEvent()”ScriptUI.events.createEvent(eventType)
Description
Section titled “Description”This function is in the JavaScript object contained in the events property.
This object is passed to a function that you register to respond to events of a certain type that occur in a window or control. Use windowObj.addEventListener() or controlObj.addEventListener() to register a handler function.
See Registering event listeners for windows or controls.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
eventType | String | The type of event, one of: |
- UIEvent | ||
- KeyboardEvent | ||
- MouseEvent | ||
--- | --- | --- |
Returns
Section titled “Returns”It returns an event object of the appropriate type:
- A UIEvent base class encapsulates input event information for an event that propagates through a container and control hierarchy. This is a base class for the more specialized keyboard and mouse event types.
- A KeyboardEvent object encapsulates information about keyboard input events.
- A MouseEvent object encapsulates information about mouse events.
ScriptUI.getResourceText()
Section titled “ScriptUI.getResourceText()”ScriptUI.getResourceText(text)
Description
Section titled “Description”Finds and returns the resource for a given text string from the host application’s resource data. If no string resource matches the given text, the text itself is returned.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
text | String | The text to match. |
Returns
Section titled “Returns”String
ScriptUI.newFont()
Section titled “ScriptUI.newFont()”ScriptUI.newFont(name, style, size);
Description
Section titled “Description”Creates a new font object for use in text controls and titles.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
name | String | The font or font family name string. |
style | String | The font style string or an enumerated value from ScriptUI.FontStyle |
size | Number | The font size in points, a number. |
Returns
Section titled “Returns”ScriptUI.newImage()
Section titled “ScriptUI.newImage()”ScriptUI.newImage( normal, disabled, pressed, rollover );
Description
Section titled “Description”Creates a new image object for use in controls that can display images, loading the associated images from the specified resources or image files.
Parameter
Section titled “Parameter”Parameter | Type | Description |
---|---|---|
normal | String | The resource name or path to the image to use for the normal or default state. |
disabled | String | The resource name or path to the image to use for the disabled state, shown when the control containing the image is disabled (enabled=false). |
pressed | String | The resource name or path to the image to use for the pressed state, shown when the user clicks on the image. |
rollover | String | The resource name or path to the image to use for the rollover state, which is shown when the cursor moves over the image. |