
62
4
User-Interface Tools
Adobe provides the ScriptUI component, which works with the ExtendScript JavaScript interpreter to
provide JavaScript scripts with the ability to create and interact with user interface elements. It provides an
object model for windows and user-interface control elements within an Adobe application.
X The first part of this chapter describes the features and programming model, with details of how you
can use JavaScript to build a user interface with ScriptUI objects.
X “ScriptUI object reference” on page 105 provides reference details of the objects, properties, methods,
and creation parameters. You can also choose the ScriptUI Classes dictionary from the Help menu in
the ExtendScript Toolkit to inspect the objects in the Object Model Viewer.
Code examples for ScriptUI
The sample code distributed with the Adobe ExtendScript SDK includes code examples that specifically
demonstrate different ways of building and populating a ScriptUI dialog.
Building ScriptUI dialogs
SnpCreateDialog.jsx
Creates a very simple, modeless dialog (a palette) with OK
and Cancel button behavior.
SnpCreateUIAddMethod.jsx
Shows how to add controls to a dialog using the add
method.
SnpCreateUIResourceSpec.jsx
Shows how to define a resource string that creates the
control hierarchy in a dialog.
SnpCreateTreeView.jsx
Shows how to create a hierarchical list with subitems.
SnpCreateProgressBar.jsx
Shows how to create, initialize, and update a progress bar.
SnpCreateSlider.jsx
Shows how to create and handle input from a slider control.
UsingFlashPlayer.jsx
Shows how to create a Flash® Player, and use it to load a play
back a movie defined in an SWF file.
ActionScriptDemo.jsx
Shows how to communicate between the Adobe
application scripting environment and the ActionScript™
scripting environment of the Flash Player.
ColorSelector.jsx
Shows how to use the graphics objects to change colors in a
window.
ColorPicker.jsx
A more complex version of the color-selection dialog shows
how to use additional graphics objects, including fonts and
paths.
SnpAlignElements.jsx
Shows how to align elements along two dimensions in order
to control the relative positions of controls within rows and
columns.
Comentarios a estos manuales