
Adobe Photoshop CS3
JavaScript Scripting Reference
JavaScript Object Reference 36
Working with Method Parameters
Optional parameters are surrounded by square brackets ( [ ] ). In the following Methods table sample, the
parameters
descriptor
and
displayDialogs
are optional and the parameter
eventID
is not.
Therefore, if you use the
executeAction()
method for the object associated with the sample Methods
table above, you
must
include an
eventID
value in the parentheses following the method name. The
eventID
value must be a number, as indicated by the
number (long)
in the table’s Parameter Type
column.
If you use an optional parameter, you must separate the parameters with a comma, as indicated by the
comma that precedes each optional parameter in the table.
Also, if you use an optional parameter, you must enter the values in the order they are listed in the table so
that the JavaScript compiler knows which value you are entering. To skip an optional parameter, insert an
extra comma to act as a placeholder.
The following sample provides values for an
eventID
and a
displayDialog
, but skips the
descriptor
parameter (represented by the empty value between two commas). The statement executes action #4233
and allows only error type dialog boxes to be displayed.
app.executeAction(4233,,error)
Method
Parameter Type
Returns
What it does
executeAction
(eventID
[, descriptor]
[, displayDialogs])
number (long)
ActionDescriptor
DialogModes
ActionDescriptor
Plays an
ActionManager
event.