Skip to content

scriptui-class

The globally available ScriptUI class provides central information about the ScriptUI module. This object is not instantiable.


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.

myGroup.alignment = [ScriptUI.Alignment.LEFT, ScriptUI.Alignment.TOP]

ScriptUI.applicationFonts

Collects the enumerated values that specify the default application fonts.

The available fonts vary according to the application and system configuration.

Object


ScriptUI.compatability

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

The internal core version number of the ScriptUI components.

String. Read only.


ScriptUI.environment

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.

Environment object


ScriptUI.events

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

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

The name of the user-interface framework with which this ScriptUI component is compatible.

String. Read only.


ScriptUI.version

The main version number of the ScriptUI component framework.

String. Read only.


ScriptUI.events.createEvent(eventType)

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.

ParameterTypeDescription
eventTypeStringThe type of event, one of:
- UIEvent
- KeyboardEvent
- MouseEvent
---------

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(text)

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.

ParameterTypeDescription
textStringThe text to match.

String


ScriptUI.newFont(name, style, size);

Creates a new font object for use in text controls and titles.

ParameterTypeDescription
nameStringThe font or font family name string.
styleStringThe font style string or an enumerated value from ScriptUI.FontStyle
sizeNumberThe font size in points, a number.

ScriptUIFont object


ScriptUI.newImage( normal, disabled, pressed, rollover );

Creates a new image object for use in controls that can display images, loading the associated images from the specified resources or image files.

ParameterTypeDescription
normalStringThe resource name or path to the image to use for the normal or default state.
disabledStringThe resource name or path to the image to use for the disabled state, shown when the control containing the image is disabled (enabled=false).
pressedStringThe resource name or path to the image to use for the pressed state, shown when the user clicks on the image.
rolloverStringThe resource name or path to the image to use for the rollover state, which is shown when the cursor moves over the image.

ScriptUIImage object