Instancesvoid autoCount (channel:
Channel, threshold:
int)
Counts the objects in the document.
| Parameter | Type | Description |
| channel | Channel | The channel to use for counting. |
| threshold | int (range: 0 - 255) | Threshold to use for counting. Range: 0 to 255. |
void changeMode (destinationMode:
ChangeMode[, options:
DocumentConversionOptions])
Changes the mode of the document.
| Parameter | Type | Description |
| destinationMode | ChangeMode: ChangeMode.GRAYSCALE ChangeMode.RGB ChangeMode.CMYK ChangeMode.LAB ChangeMode.BITMAP ChangeMode.INDEXEDCOLOR ChangeMode.MULTICHANNEL | The mode to change to. |
| options | DocumentConversionOptions | Options for changing the mode. (Optional) |
void close ([saving:
SaveOptions=SaveOptions.PROMPTTOSAVECHANGES])
Closes the document.
| Parameter | Type | Description |
| saving | SaveOptions: SaveOptions.SAVECHANGES SaveOptions.DONOTSAVECHANGES SaveOptions.PROMPTTOSAVECHANGES | Specifies whether changes should be saved before closing. (default: SaveOptions.PROMPTTOSAVECHANGES) (Optional) |
void convertProfile (destinationProfile:
string, intent:
Intent[, blackPointCompensation:
bool][, dither:
bool=true])
Converts the document from using one color profile to using another.
| Parameter | Type | Description |
| destinationProfile | string | The color profile to convert to. Either a string specifying a color profile, one of the working color spaces, or Lab color. |
| intent | Intent: Intent.PERCEPTUAL Intent.SATURATION Intent.RELATIVECOLORIMETRIC Intent.ABSOLUTECOLORIMETRIC | The conversion intent. |
| blackPointCompensation | bool | If true, black point compensation is used. (Optional) |
| dither | bool | If true, dither is used. (default: true) (Optional) |
void crop (bounds:
UnitRect[, angle:
number=0][, width:
UnitValue][, height:
UnitValue])
Crops the document.
| Parameter | Type | Description |
| bounds | UnitRect | The area to crop. |
| angle | number | The angle of cropping bounds. (default: 0) (Optional) |
| width | UnitValue | The width of the resulting document. (Optional) |
| height | UnitValue | The height of the resulting document. (Optional) |
Document duplicate (relativeObject:
Object, insertionLocation:
ElementPlacement)
Duplicate this object.
| Parameter | Type | Description |
| relativeObject | Object | |
| insertionLocation | ElementPlacement: ElementPlacement.PLACEAFTER ElementPlacement.PLACEBEFORE ElementPlacement.PLACEATEND | |
Document duplicate ([name:
string][, mergeLayersOnly:
bool])
Creates a duplicate of the document object.
| Parameter | Type | Description |
| name | string | The name of the new document. (Optional) |
| mergeLayersOnly | bool | If ture, duplicates merged layers only. (Optional) |
void exportDocument (exportIn:
File[, exportAs:
ExportType=ExportType.ILLUSTRATORPATHS][, options:
ExportOptions])
Exports the document.
| Parameter | Type | Description |
| exportIn | File | The file to export to. |
| exportAs | ExportType: ExportType.ILLUSTRATORPATHS ExportType.SAVEFORWEB | The type of export. (default: ExportType.ILLUSTRATORPATHS) (Optional) |
| options | ExportOptions | Options for the specified export type. (Optional) |
void flatten ()
Flattens all layers.
void flipCanvas (direction:
Direction)
Flips the canvas horizontally or vertically.
| Parameter | Type | Description |
| direction | Direction: Direction.HORIZONTAL Direction.VERTICAL | The direction in which to flip the canvas. |
void importAnnotations (file:
File)
Imports annotations into the document.
| Parameter | Type | Description |
| file | File | The document to import annotations from. |
void mergeVisibleLayers ()
Flattens all visible layers in the document.
ArtLayer paste ([intoSelection:
bool=false])
Pastes contents of the clipboard into the document.
| Parameter | Type | Description |
| intoSelection | bool | If true, contents are pasted into the current selection. (default: false) (Optional) |
void print ([postScriptEncoding:
PrintEncoding=PrintEncoding.BINARY][, sourceSpace:
SourceSpaceType=SourceSpaceType.DOCUMENT][, printSpace:
string][, intent:
Intent=Intent.RELATIVECOLORIMETRIC][, blackPointCompensation:
bool=true])
Prints the document.
| Parameter | Type | Description |
| postScriptEncoding | PrintEncoding: PrintEncoding.BINARY PrintEncoding.JPEG PrintEncoding.ASCII | The encoding type. (default: PrintEncoding.BINARY) (Optional) |
| sourceSpace | SourceSpaceType: SourceSpaceType.DOCUMENT SourceSpaceType.PROOF | The color space for the source. (default: SourceSpaceType.DOCUMENT) (Optional) |
| printSpace | string | The color space for the printer. Can be "nothing" (meaning same as source); one of the working spaces or Lab color; or a string specifying a color space. Default: nothing. (Optional) |
| intent | Intent: Intent.PERCEPTUAL Intent.SATURATION Intent.RELATIVECOLORIMETRIC Intent.ABSOLUTECOLORIMETRIC | The color conversion intent. (default: Intent.RELATIVECOLORIMETRIC) (Optional) |
| blackPointCompensation | bool | If true, black point compensation is used. (default: true) (Optional) |
void printOneCopy ()
Print one copy of the document.
void rasterizeAllLayers ()
Rasterizes all layers.
void recordMeasurements ([source:
MeasurementSource][, dataPoints:
Array
of string])
Records the measurements of document.
| Parameter | Type | Description |
| source | MeasurementSource: MeasurementSource.MEASURESELECTION MeasurementSource.MEASURECOUNTTOOL MeasurementSource.MEASURERULERTOOL | The source of the measurements to record. (Optional) |
| dataPoints |
Array
of string | An array of identifiers of data points to record. Any data points not appropriate for the specified source are ignored. (Optional) |
void resizeCanvas ([width:
UnitValue][, height:
UnitValue][, anchor:
AnchorPosition=AnchorPosition.MIDDLECENTER])
Changes the size of the canvas.
| Parameter | Type | Description |
| width | UnitValue | The desired width of the canvas. (Optional) |
| height | UnitValue | The desired height of the canvas. (Optional) |
| anchor | AnchorPosition: AnchorPosition.TOPLEFT AnchorPosition.TOPCENTER AnchorPosition.TOPRIGHT AnchorPosition.MIDDLELEFT AnchorPosition.MIDDLECENTER AnchorPosition.MIDDLERIGHT AnchorPosition.BOTTOMLEFT AnchorPosition.BOTTOMCENTER AnchorPosition.BOTTOMRIGHT | The anchor point to resize around. (default: AnchorPosition.MIDDLECENTER) (Optional) |
void resizeImage ([width:
UnitValue][, height:
UnitValue][, resolution:
number][, resampleMethod:
ResampleMethod=ResampleMethod.BICUBIC])
Changes the size of the image.
| Parameter | Type | Description |
| width | UnitValue | The desired width of the image. (Optional) |
| height | UnitValue | The desired height of the image. (Optional) |
| resolution | number | The resolution (in pixels per inch) (Optional) |
| resampleMethod | ResampleMethod: ResampleMethod.NONE ResampleMethod.NEARESTNEIGHBOR ResampleMethod.BILINEAR ResampleMethod.BICUBIC ResampleMethod.BICUBICSHARPER ResampleMethod.BICUBICSMOOTHER | The downsample method. (default: ResampleMethod.BICUBIC) (Optional) |
void revealAll ()
Expands the document to show clipped sections.
void rotateCanvas (angle:
number)
Rotates the canvas.
| Parameter | Type | Description |
| angle | number | The number of degrees to rotate. A positive angle rotates the canvas clockwise; a negative value rotates the canvas counter-clockwise. |
void save ()
Saves the document.
void saveAs (saveIn:
File[, options:
any][, asCopy:
bool][, extensionType:
Extension])
Saves the document with the specified save options.
| Parameter | Type | Description |
| saveIn | File | The file to save to, specified as a string containing the full file path or an alias. If not specified, the document is saved to its existing file. |
| options |
any
| Options for the specified file type. (Optional) |
| asCopy | bool | Saves the document as a copy, leaving the original open. (Optional) |
| extensionType | Extension: Extension.NONE Extension.LOWERCASE Extension.UPPERCASE | Appends the specified extension to the file name. (Optional) |
Array
of Document splitChannels ()
Splits the channels of the document.
void suspendHistory (historyString:
string, javaScriptString:
string)
Provides a single history state for the entire script. Allows a single undo for all actions taken in the script.
| Parameter | Type | Description |
| historyString | string | The string to use for the history state. |
| javaScriptString | string | A string of JavaScript code to execute during the suspension of history. |
void trap (width:
int)
Applies trapping to a CMYK document. Valid only when 'mode' = CMYK.
| Parameter | Type | Description |
| width | int | The trap width in pixels. |
void trim ([type:
TrimType=TrimType.TOPLEFT][, top:
bool=true][, left:
bool=true][, bottom:
bool=true][, right:
bool=true])
Trims the transparent area around the image on the specified sides of the canvas.
| Parameter | Type | Description |
| type | TrimType: TrimType.TRANSPARENT TrimType.TOPLEFT TrimType.BOTTOMRIGHT | The color or type of pixels to base the trim on. (default: TrimType.TOPLEFT) (Optional) |
| top | bool | If true, trims away the top of the document. (default: true) (Optional) |
| left | bool | If true, trims away the left of the document. (default: true) (Optional) |
| bottom | bool | If true, trims away the bottom of the document. (default: true) (Optional) |
| right | bool | If true, trims away the right of the document. (default: true) (Optional) |
|