Specifications

Table Of Contents
Adobe Photoshop CS6
JavaScript Scripting Reference JavaScript Object Reference 36
When a parameter type or return value is a constant or another object, the value is a hypertext link to the
listing for that constant or object.
Parameters can be required or optional. Optional parameters are indicated in the table by square brackets
([]). In the example, the first parameters, bounds, is required. The remaining parameters are all optional.
You must pass a value for each required parameter. You can leave out optional parameters if there are no
remaining values to pass; however, if you wish to use the default value for any optional parameter that is
not the last one specified, pass
undefined as a placeholder. You must enter the values in the order they are
listed, so that the JavaScript compiler knows which value you are entering.
For example, the following passes only the required parameter (using a previously-defined variable for the
bounding region):
app.activeDocument.crop( myRegion );
The following skips the angle parameter, specifies the width value, and omits the final height value:
var myWidth = new UnitValue( "500 pixels" );
app.executeAction( myRegion,undefined,myWidth );
Method Parameter type Returns What it does
crop
(bounds
[, angle]
[, width]
[, height])
array of 4
UnitValue
number
UnitValue
UnitValue
Crops the document. The
bounds parameter is an array of
four coordinates for the region
remaining after cropping, [left,
top, right, bottom].