Application |
The active containment object for the layers and all other objects in the script; the basic canvas for the file.
Go to Property Listing | Method Listing
duplicate, close, convertProfile, changeMode, crop, exportDocument, flipCanvas, importAnnotations, flatten, mergeVisibleLayers, paste, print, printOneCopy, revealAll, rasterizeAllLayers, recordMeasurements, rotateCanvas, resizeCanvas, resizeImage, splitChannels, save, saveAs, suspendHistory, trap, trim, duplicate, autoCount
ArtLayer, ArtLayers, BitsPerChannelType, Boolean, Channel, Channels, ColorProfileType, ColorSamplers, CountItems, DocumentInfo, DocumentMode, DocumentPrintSettings, File, Guides, HistoryState, HistoryStates, Layer, LayerComps, LayerSets, Layers, MeasurementScale, Number, PathItems, Selection, String, UnitValue, XMPMetadata
Property |
Type |
Access |
Description |
---|---|---|---|
read/write |
The selected channels. |
||
read/write |
The history state to use with the history brush. |
||
read/write |
The current history state for this document. |
||
read/write |
The selected layer. |
||
readonly |
The art layers collection in the document. |
||
readonly |
The background layer for the document. |
||
read/write |
The number of bits per channel. |
||
readonly |
The channels collection in this document. |
||
read/write |
The name of the color profile. Valid only when no value is specified for color profile kind (to indicate a custom color profile). |
||
read/write |
The type of color model that defines the working space of the document. |
||
readonly |
The current color samplers associated with the document. |
||
readonly |
The color component channels for this document. |
||
readonly |
The current count items in the document. |
||
readonly |
The full path name of the document. |
||
readonly |
The guides in this document. |
||
readonly |
The height of the document. |
||
Array of Int |
readonly |
A histogram showing the number of pixels at each color intensity level for the composite channel. Valid only when 'mode' = RGB, CMYK, or indexed. |
|
readonly |
The history states collection in this document. |
||
Int |
readonly |
The unique ID of this document. |
|
readonly |
Metadata about the document. |
||
readonly |
The layer comps collection in this document. |
||
readonly |
The layer sets collection in the document. |
||
readonly |
The layers collection in the document. |
||
readonly |
If true, the document is a workgroup document. |
||
readonly |
The measurement scale of the document. |
||
readonly |
The color profile. |
||
readonly |
The document name. |
||
readonly |
The object's container. |
||
readonly |
The path to the document. |
||
readonly |
The path items collection in this document. |
||
read/write |
The (custom) pixel aspect ratio of the document. Range: 0.100 to 10.000. |
||
readonly |
Document print settings. |
||
read/write |
If true, the document is in Quick Mask mode. |
||
readonly |
The resolution of the document (in pixels per inch) |
||
readonly |
If true, the document been saved since the last change. |
||
readonly |
The selected area of the document. |
||
readonly |
The class name of the object. |
||
readonly |
The width of the document. |
||
readonly |
The XMP properties of the document. The Camera RAW settings are stored here. |
undefined autoCount (channel:Channel, threshold:Int)
Counts the objects in the document.
Parameter |
Type |
Description |
---|---|---|
channel |
The channel to use for counting. |
|
threshold |
Int (range 0 - 255) |
Threshold to use for counting. Range: 0 to 255. |
undefined changeMode (destinationMode:ChangeMode, [options:DocumentConversionOptions])
Changes the mode of the document.
Parameter |
Type |
Description |
---|---|---|
destinationMode |
The mode to change to. |
|
options |
Options for changing the mode. |
undefined close ([saving:SaveOptionsType=SaveOptionsType])
Closes the document.
Parameter |
Type |
Description |
---|---|---|
saving |
Specifies whether changes should be saved before closing. (default: SaveOptionsType.PROMPTTOSAVECHANGES) |
undefined convertProfile (destinationProfile:String, intent:Intent, [blackPointCompensation:Boolean], [dither:Boolean=Boolean])
Converts the document from using one color profile to using another.
Parameter |
Type |
Description |
---|---|---|
destinationProfile |
The color profile to convert to. Either a string specifying a color profile, one of the working color spaces, or Lab color. |
|
intent |
The conversion intent. |
|
blackPointCompensation |
If true, black point compensation is used. |
|
dither |
If true, dither is used. (default: true) |
undefined crop (bounds:UnitRect, [angle:Number=Number], [width:UnitValue], [height:UnitValue])
Crops the document.
Parameter |
Type |
Description |
---|---|---|
bounds |
UnitRect |
The area to crop. |
angle |
The angle of cropping bounds. (default: 0) |
|
width |
The width of the resulting document. |
|
height |
The height of the resulting document. |
Document duplicate (relativeObject:Object, insertionLocation:ElementPlacement)
Duplicate this object.
Parameter |
Type |
Description |
---|---|---|
relativeObject |
||
insertionLocation |
Document duplicate ([name:String], [mergeLayersOnly:Boolean])
Creates a duplicate of the document object.
Parameter |
Type |
Description |
---|---|---|
name |
The name of the new document. |
|
mergeLayersOnly |
If ture, duplicates merged layers only. |
undefined exportDocument (exportIn:File, [exportAs:ExportType=ExportType], [options:ExportOptions])
Exports the document.
Parameter |
Type |
Description |
---|---|---|
exportIn |
The file to export to. |
|
exportAs |
The type of export. (default: ExportType.ILLUSTRATORPATHS) |
|
options |
Options for the specified export type. |
undefined flatten ()
Flattens all layers.
undefined flipCanvas (direction:Direction)
Flips the canvas horizontally or vertically.
Parameter |
Type |
Description |
---|---|---|
direction |
The direction in which to flip the canvas. |
undefined importAnnotations (file:File)
Imports annotations into the document.
Parameter |
Type |
Description |
---|---|---|
file |
The document to import annotations from. |
undefined mergeVisibleLayers ()
Flattens all visible layers in the document.
ArtLayer paste ([intoSelection:Boolean=Boolean])
Pastes contents of the clipboard into the document.
Parameter |
Type |
Description |
---|---|---|
intoSelection |
If true, contents are pasted into the current selection. (default: false) |
undefined print ([sourceSpace:SourceSpaceType=SourceSpaceType], [printSpace:String], [intent:Intent=Intent], [blackPointCompensation:Boolean=Boolean])
Prints the document.
Parameter |
Type |
Description |
---|---|---|
sourceSpace |
The color space for the source. (default: SourceSpaceType.DOCUMENT) |
|
printSpace |
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. |
|
intent |
The color conversion intent. (default: Intent.RELATIVECOLORIMETRIC) |
|
blackPointCompensation |
If true, black point compensation is used. (default: true) |
undefined printOneCopy ()
Print one copy of the document.
undefined rasterizeAllLayers ()
Rasterizes all layers.
undefined recordMeasurements ([source:MeasurementSource], [dataPoints:Array of String])
Records the measurements of document.
Parameter |
Type |
Description |
---|---|---|
source |
The source of the measurements to record. |
|
dataPoints |
An array of identifiers of data points to record. Any data points not appropriate for the specified source are ignored. |
undefined resizeCanvas ([width:UnitValue], [height:UnitValue], [anchor:AnchorPosition=AnchorPosition])
Changes the size of the canvas.
Parameter |
Type |
Description |
---|---|---|
width |
The desired width of the canvas. |
|
height |
The desired height of the canvas. |
|
anchor |
The anchor point to resize around. (default: AnchorPosition.MIDDLECENTER) |
undefined resizeImage ([width:UnitValue], [height:UnitValue], [resolution:Number], [resampleMethod:ResampleMethod=ResampleMethod], [amount:Int=Int])
Changes the size of the image.
Parameter |
Type |
Description |
---|---|---|
width |
The desired width of the image. |
|
height |
The desired height of the image. |
|
resolution |
The resolution (in pixels per inch) |
|
resampleMethod |
The downsample method. (default: ResampleMethod.BICUBIC) |
|
amount |
Int (range 0 - 100) |
Amount of noise value when using preserve details (range: 0 - 100) (default: 0) |
undefined revealAll ()
Expands the document to show clipped sections.
undefined rotateCanvas (angle:Number)
Rotates the canvas.
Parameter |
Type |
Description |
---|---|---|
angle |
The number of degrees to rotate. A positive angle rotates the canvas clockwise; a negative value rotates the canvas counter-clockwise. |
undefined save ()
Saves the document.
undefined saveAs (saveIn:File, [options:Varies], [asCopy:Boolean], [extensionType:MacExtensionType])
Saves the document with the specified save options.
Parameter |
Type |
Description |
---|---|---|
saveIn |
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 |
Varies |
Options for the specified file type. |
asCopy |
Saves the document as a copy, leaving the original open. |
|
extensionType |
Appends the specified extension to the file name. |
Document splitChannels ()
Splits the channels of the document.
undefined 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 |
The string to use for the history state. |
|
javaScriptString |
A string of JavaScript code to execute during the suspension of history. |
undefined trap (width:Int)
Applies trapping to a CMYK document. Valid only when 'mode' = CMYK.
Parameter |
Type |
Description |
---|---|---|
width |
Int |
The trap width in pixels. |
undefined trim ([type:TrimType=TrimType], [top:Boolean=Boolean], [left:Boolean=Boolean], [bottom:Boolean=Boolean], [right:Boolean=Boolean])
Trims the transparent area around the image on the specified sides of the canvas.
Parameter |
Type |
Description |
---|---|---|
type |
The color or type of pixels to base the trim on. (default: TrimType.TOPLEFT) |
|
top |
If true, trims away the top of the document. (default: true) |
|
left |
If true, trims away the left of the document. (default: true) |
|
bottom |
If true, trims away the bottom of the document. (default: true) |
|
right |
If true, trims away the right of the document. (default: true) |
Application.activeDocument