
CHAPTER 4: User-Interface Tools Resource specifications 79
testBtn: Button { text: ’Test’ }
The following resource string specifies a panel that contains grouped StaticText and EditText controls:
"msgPnl: Panel { orientation:’column’, alignChildren:[’right’, ’top’],\
text: ’Messages’, \
title: Group { \
st: StaticText { text:’Alert box title:’ }, \
et: EditText { text:’Sample Alert’, characters:35 } \
}
msg: Group { \
st: StaticText { text:’Alert message:’ }, \
et: EditText { properties:{multiline:true}, \
text:’<your message here>’ \
} \
}"
The property with name properties specifies creation properties; see “Creation properties” on page 66.
A property value can be specified as
null, true, false, a string, a number, an inline array, or an object.
X An inline array contains one or more values in the form:
[value, value,...]
X
An object can be an inline object, or a named object, in the form:
{classname inlineObject}
In this case, the classname must be one of the control class names list in “Types of controls” on
page 67.
X An inline object contains one or more properties, in the form:
{propertyName:propertyValue,propertyName:propertyValue,... }
Using resource strings
These examples in the Adobe ExtendScript SDK demonstrate how to use resource specification strings:
The two Alert Box Builder examples create the same dialog to collect values from the user.
AlertBoxBuilder1.jsx
Demonstrates one way to use resource strings, creating a dialog that allows
the user to enter some values, and then using those values to construct the
resource string for a customizable alert dialog.
AlertBoxBuilder2.jsx
Constructs the same dialog, using a resource string (rather than the add()
method) to specify all of the dialog contents for the user-input dialog.
Comentários a estes Manuais