Document
Document
Section titled “Document”app.activeDocument
Description
Section titled “Description”An Illustrator document. Documents are contained in the Application object.
The default document settings—those properties starting with the word “default”—are global settings that affect the current document. Be sure to modify these default properties only when a document is open. Note that if you set default properties to desired values before creating new objects, you can streamline your scripts, eliminating the need to specify specific properties such as fillColor
and stroked
that have default properties.
A document’s color space, height, and width can only be set when the document is created. You cannot modify these properties in an existing document. See Application.open() for more information on how document color spaces are handled.
Properties
Section titled “Properties”Document.activeDataset
Section titled “Document.activeDataset”app.activeDocument.activeDataset
Description
Section titled “Description”The currently opened dataset.
Document.activeLayer
Section titled “Document.activeLayer”app.activeDocument.activeLayer
Description
Section titled “Description”The active layer in the document.
Document.activeView
Section titled “Document.activeView”app.activeDocument.activeView
Description
Section titled “Description”The document’s current view.
View; read-only.
Document.artboards
Section titled “Document.artboards”app.activeDocument.artboards
Description
Section titled “Description”All artboards in the document.
Artboards; read-only.
Document.brushes
Section titled “Document.brushes”app.activeDocument.brushes
Description
Section titled “Description”The brushes contained in the document.
Brushes; read-only.
Document.characterStyles
Section titled “Document.characterStyles”app.activeDocument.characterStyles
Description
Section titled “Description”The list of character styles in this document.
CharacterStyles; read-only.
Document.compoundPathItems
Section titled “Document.compoundPathItems”app.activeDocument.compoundPathItems
Description
Section titled “Description”The compound path items contained in the document.
CompoundPathItems; read-only.
Document.cropBox
Section titled “Document.cropBox”app.activeDocument.cropBox
Description
Section titled “Description”The boundary of the document’s cropping box for output, or null
if no value has been set.
Array of 4 numbers.
Document.cropStyle
Section titled “Document.cropStyle”app.activeDocument.cropStyle
Description
Section titled “Description”The style of the document’s cropping box.
Document.dataSets
Section titled “Document.dataSets”app.activeDocument.dataSets
Description
Section titled “Description”The datasets contained in the document.
Datasets; read-only.
Document.defaultFillColor
Section titled “Document.defaultFillColor”app.activeDocument.defaultFillColor
Description
Section titled “Description”The color to use to fill new paths if defaultFilled
is true
.
Document.defaultFilled
Section titled “Document.defaultFilled”app.activeDocument.defaultFilled
Description
Section titled “Description”If true
, a new path should be filled.
Boolean.
Document.defaultFillOverprint
Section titled “Document.defaultFillOverprint”app.activeDocument.defaultFillOverprint
Description
Section titled “Description”If true
, the art beneath a filled object should be overprinted by default.
Boolean.
Document.defaultStrokeCap
Section titled “Document.defaultStrokeCap”app.activeDocument.defaultStrokeCap
Description
Section titled “Description”Default type of line capping for paths created.
Document.defaultStrokeColor
Section titled “Document.defaultStrokeColor”app.activeDocument.defaultStrokeColor
Description
Section titled “Description”The stroke color for new paths if default stroked is true
.
Document.defaultStroked
Section titled “Document.defaultStroked”app.activeDocument.defaultStroked
Description
Section titled “Description”If true
, a new path should be stroked.
Boolean.
Document.defaultStrokeDashes
Section titled “Document.defaultStrokeDashes”app.activeDocument.defaultStrokeDashes
Description
Section titled “Description”Default lengths for dashes and gaps in dashed lines, starting with the first dash length, followed by the first gap length, and so on. Set to an empty object, {}, for solid line.
Object.
Document.defaultStrokeDashOffset
Section titled “Document.defaultStrokeDashOffset”app.activeDocument.defaultStrokeDashOffset
Description
Section titled “Description”The default distance into the dash pattern at which the pattern should be started for new paths.
Number (double).
Document.defaultStrokeJoin
Section titled “Document.defaultStrokeJoin”app.activeDocument.defaultStrokeJoin
Description
Section titled “Description”Default type of joints in new paths.
Document.defaultStrokeMiterLimit
Section titled “Document.defaultStrokeMiterLimit”app.activeDocument.defaultStrokeMiterLimit
Description
Section titled “Description”When a default stroke join is set to mitered
, this property specifies when the join will be converted to beveled (squared-off) by default.
The default miter limit of 4 means that when the length of the point reaches four times the stroke weight, the join switches from a miter join to a bevel join.
Range: 1 to 500; a value of 1 specifies a bevel join.
Number (double).
Document.defaultStrokeOverprint
Section titled “Document.defaultStrokeOverprint”app.activeDocument.defaultStrokeOverprint
Description
Section titled “Description”If true
, the art beneath a stroked object should be overprinted by default.
Boolean.
Document.defaultStrokeWidth
Section titled “Document.defaultStrokeWidth”app.activeDocument.defaultStrokeWidth
Description
Section titled “Description”Default width of stroke for new paths.
Number (double).
Document.documentColorSpace
Section titled “Document.documentColorSpace”app.activeDocument.documentColorSpace
Description
Section titled “Description”The color specification system to use for this document’s color space.
Document.fullName
Section titled “Document.fullName”app.activeDocument.fullName
Description
Section titled “Description”The file associated with the document, which includes the complete path to the file.
File object; read-only.
Document.geometricBounds
Section titled “Document.geometricBounds”app.activeDocument.geometricBounds
Description
Section titled “Description”The bounds of the illustration excluding the stroke width of any objects in the document.
Array of 4 numbers; read-only.
Document.gradients
Section titled “Document.gradients”app.activeDocument.gradients
Description
Section titled “Description”The gradients contained in the document.
Gradients; read-only.
Document.graphicStyles
Section titled “Document.graphicStyles”app.activeDocument.graphicStyles
Description
Section titled “Description”The graphic styles defined in this document.
GraphicStyles; read-only.
Document.graphItems
Section titled “Document.graphItems”app.activeDocument.graphItems
Description
Section titled “Description”The graph art items in this document.
GraphItems; read-only.
Document.groupItems
Section titled “Document.groupItems”app.activeDocument.groupItems
Description
Section titled “Description”The group items contained in the document.
GroupItems; read-only.
Document.height
Section titled “Document.height”app.activeDocument.height
Description
Section titled “Description”The height of the document.
Number (double); read-only.
Document.inkList
Section titled “Document.inkList”app.activeDocument.inkList
Description
Section titled “Description”The list of inks in this document.
Object; read-only.
Document.kinsokuSet
Section titled “Document.kinsokuSet”app.activeDocument.kinsokuSet
Description
Section titled “Description”The Kinsoku set of characters that cannot begin or end a line of Japanese text.
Object; read-only.
Document.layers
Section titled “Document.layers”app.activeDocument.layers
Description
Section titled “Description”The layers contained in the document.
Layers; read-only.
Document.legacyTextItems
Section titled “Document.legacyTextItems”app.activeDocument.legacyTextItems
Description
Section titled “Description”The legacy text items in the document.
LegacyTextItems; read-only.
Document.meshItems
Section titled “Document.meshItems”app.activeDocument.meshItems
Description
Section titled “Description”The mesh art items contained in the document.
MeshItems; read-only.
Document.mojikumiSet
Section titled “Document.mojikumiSet”app.activeDocument.mojikumiSet
Description
Section titled “Description”A list of names of predefined Mojikumi sets which specify the spacing for the layout and composition of Japanese text.
Object; read-only.
Document.name
Section titled “Document.name”app.activeDocument.name
Description
Section titled “Description”The document’s name (not the complete file path to the document).
String; read-only.
Document.nonNativeItems
Section titled “Document.nonNativeItems”app.activeDocument.nonNativeItems
Description
Section titled “Description”The non-native art items in this document.
NonNativeItems; read-only.
Document.outputResolution
Section titled “Document.outputResolution”app.activeDocument.outputResolution
Description
Section titled “Description”The current output resolution for the document in dots per inch (dpi).
Number (double); read-only.
Document.pageItems
Section titled “Document.pageItems”app.activeDocument.pageItems
Description
Section titled “Description”The page items (all art item classes) contained in the document.
PageItems; read-only.
Document.pageOrigin
Section titled “Document.pageOrigin”app.activeDocument.pageOrigin
Description
Section titled “Description”The zero-point of the page in the document without margins, relative to the overall height and width.
Array of 2 numbers.
Document.paragraphStyles
Section titled “Document.paragraphStyles”app.activeDocument.paragraphStyles
Description
Section titled “Description”The list of paragraph styles in this document.
ParagraphStyles; read-only.
Document.parent
Section titled “Document.parent”app.activeDocument.parent
Description
Section titled “Description”The application that contains this document.
Application; read-only.
Document.path
Section titled “Document.path”app.activeDocument.path
Description
Section titled “Description”The file associated with the document, which includes the complete path to the file.
File object; read-only.
Document.pathItems
Section titled “Document.pathItems”app.activeDocument.pathItems
Description
Section titled “Description”The path items contained in this document.
PathItems; read-only.
Document.patterns
Section titled “Document.patterns”app.activeDocument.patterns
Description
Section titled “Description”The patterns contained in this document.
Patterns; read-only.
Document.placedItems
Section titled “Document.placedItems”app.activeDocument.placedItems
Description
Section titled “Description”The placed items contained in this document.
PlacedItems; read-only.
Document.pluginItems
Section titled “Document.pluginItems”app.activeDocument.pluginItems
Description
Section titled “Description”The plug-in items contained in this document.
PluginItems; read-only.
Document.printTiles
Section titled “Document.printTiles”app.activeDocument.printTiles
Description
Section titled “Description”If true
, this document should be printed as tiled output.
Boolean; read-only.
Document.rasterEffectSettings
Section titled “Document.rasterEffectSettings”app.activeDocument.rasterEffectSettings
Description
Section titled “Description”The document’s raster effect settings.
RasterEffectOptions; read-only.
Document.rasterItems
Section titled “Document.rasterItems”app.activeDocument.rasterItems
Description
Section titled “Description”The raster items contained in this document.
RasterItems; read-only.
Document.rulerOrigin
Section titled “Document.rulerOrigin”app.activeDocument.rulerOrigin
Description
Section titled “Description”The zero-point of the rulers in the document relative to the bottom left of the document.
Array of 2 numbers.
Document.rulerUnits
Section titled “Document.rulerUnits”app.activeDocument.rulerUnits
Description
Section titled “Description”The default measurement units for the rulers in the document.
RulerUnits; read-only.
Document.saved
Section titled “Document.saved”app.activeDocument.saved
Description
Section titled “Description”If true
, the document has not been changed since last time it was saved.
Boolean.
Document.selection
Section titled “Document.selection”app.activeDocument.selection
Description
Section titled “Description”References to the objects in this document’s current selection, or null
when nothing is selected.
A reference to an insertion point is returned when there is an active insertion point in the contents of a selected text art item. Similarly, a reference to a range of text is returned when characters are selected in the contents of a text art item.
Array of objects.
Document.showPlacedImages
Section titled “Document.showPlacedImages”app.activeDocument.showPlacedImages
Description
Section titled “Description”If true
, placed images should be displayed in the document.
Boolean; read-only.
Document.splitLongPaths
Section titled “Document.splitLongPaths”app.activeDocument.splitLongPaths
Description
Section titled “Description”If true
, long paths should be split when printing.
Boolean; read-only.
Document.spots
Section titled “Document.spots”app.activeDocument.spots
Description
Section titled “Description”The spot colors contained in this document.
Spots; read-only.
Document.stationery
Section titled “Document.stationery”app.activeDocument.stationery
Description
Section titled “Description”If true
, the file is a stationery file.
Boolean; read-only.
Document.stories
Section titled “Document.stories”app.activeDocument.stories
Description
Section titled “Description”The story items in this document.
Stories; read-only.
Document.swatches
Section titled “Document.swatches”app.activeDocument.swatches
Description
Section titled “Description”The swatches in this document.
Swatches; read-only.
Document.swatchGroups
Section titled “Document.swatchGroups”app.activeDocument.swatchGroups
Description
Section titled “Description”The swatch groups in this document.
SwatchGroups; read-only.
Document.symbolItems
Section titled “Document.symbolItems”app.activeDocument.symbolItems
Description
Section titled “Description”The art items in the document linked to symbols.
SymbolItems; read-only.
Document.symbols
Section titled “Document.symbols”app.activeDocument.symbols
Description
Section titled “Description”The symbols in this document.
Symbols; read-only.
Document.tags
Section titled “Document.tags”app.activeDocument.tags
Description
Section titled “Description”The tags in this document.
Tags; read-only.
Document.textFrames
Section titled “Document.textFrames”app.activeDocument.textFrames
Description
Section titled “Description”The text frames in this document.
TextFrameItems; read-only.
Document.tileFullPages
Section titled “Document.tileFullPages”app.activeDocument.tileFullPages
Description
Section titled “Description”If true
, full pages should be tiled when printing this document.
Boolean; read-only.
Document.typename
Section titled “Document.typename”app.activeDocument.typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
Document.useDefaultScreen
Section titled “Document.useDefaultScreen”app.activeDocument.useDefaultScreen
Description
Section titled “Description”If true
, the printer’s default screen should be used when printing this document.
Boolean; read-only.
Document.variables
Section titled “Document.variables”app.activeDocument.variables
Description
Section titled “Description”The variables defined in this document.
Variables; read-only.
Document.variablesLocked
Section titled “Document.variablesLocked”app.activeDocument.variablesLocked
Description
Section titled “Description”If true, the variables are locked.
Boolean.
Document.views
Section titled “Document.views”app.activeDocument.views
Description
Section titled “Description”The views contained in this document.
Views; read-only.
Document.visibleBounds
Section titled “Document.visibleBounds”app.activeDocument.visibleBounds
Description
Section titled “Description”The visible bounds of the document, including stroke width of any objects in the illustration.
Array of 4 numbers; read-only.
Document.width
Section titled “Document.width”app.activeDocument.width
Description
Section titled “Description”The width of this document.
Number (double); read-only.
Document.XMPString
Section titled “Document.XMPString”app.activeDocument.XMPString
Description
Section titled “Description”The XMP metadata packet associated with this document.
String.
Methods
Section titled “Methods”Document.activate()
Section titled “Document.activate()”app.activeDocument.activate()
Description
Section titled “Description”Brings the first window associated with the document to the front.
Returns
Section titled “Returns”Nothing.
Document.arrange()
Section titled “Document.arrange()”app.activeDocument.arrange([layoutStyle])
Description
Section titled “Description”Arranges multiple documents in the given layout style.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
layoutStyle | DocumentLayoutStyle, optional | The layout style to arrange documents in |
Returns
Section titled “Returns”Boolean.
Document.close()
Section titled “Document.close()”app.activeDocument.close([saveOptions])
Description
Section titled “Description”Closes a document using specified save options.
When you close a document, you should set your document reference to null
to prevent your script from accidentally trying to access closed documents.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
saveOptions | SaveOptions | Save options to close with |
Returns
Section titled “Returns”Nothing.
Document.closeNoUI()
Section titled “Document.closeNoUI()”app.activeDocument.closeNoUI()
Description
Section titled “Description”Closes the specified non-UI document.
Returns
Section titled “Returns”Nothing.
Document.convertCoordinate()
Section titled “Document.convertCoordinate()”app.activeDocument.convertCoordinate(coordinate, source, destination)
Description
Section titled “Description”Converts the given point between artboard and document coordinate systems. Returns the converted point coordinates.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
coordinate | Point | Point to convert |
source | CoordinateSystem | Source coordinate system |
destination | CoordinateSystem | Destination coordinate system |
Returns
Section titled “Returns”Point.
Document.exportFile()
Section titled “Document.exportFile()”app.activeDocument.exportFile(exportFile, exportFormat [,options])
Description
Section titled “Description”Exports the document to the specified file using one of the predefined export file formats. The appropriate file extension is automatically appended to the file name, except for Photoshop® documents. For these, you must include the file extension (PSD) in the file specification.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
exportFile | File object | File to save |
exportFormat | ExportType | Export file format |
options | Variable, optional | todo |
Returns
Section titled “Returns”Nothing.
Document.exportPDFPreset()
Section titled “Document.exportPDFPreset()”app.activeDocument.exportPDFPreset(file)
Description
Section titled “Description”Exports the current PDF preset values to the file.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
file | File object | Preset file to export to |
Returns
Section titled “Returns”Nothing.
Document.exportPerspectiveGridPreset()
Section titled “Document.exportPerspectiveGridPreset()”app.activeDocument.exportPerspectiveGridPreset(file)
Description
Section titled “Description”Exports the current perspective grid preset values to the file.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
file | File object | Preset file to export to |
Returns
Section titled “Returns”Nothing.
Document.exportPrintPreset()
Section titled “Document.exportPrintPreset()”app.activeDocument.exportPrintPreset(file)
Description
Section titled “Description”Exports the current print preset values to the file.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
file | File object | Preset file to export to |
Returns
Section titled “Returns”Nothing.
Document.exportVariables()
Section titled “Document.exportVariables()”app.activeDocument.exportVariables(fileSpec)
Description
Section titled “Description”Saves datasets into an XML library. The datasets contain variables and their associated dynamic data.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
fileSpec | File object | XML Library file to export to |
Returns
Section titled “Returns”Nothing.
Document.fitArtboardToSelectedArt()
Section titled “Document.fitArtboardToSelectedArt()”app.activeDocument.fitArtboardToSelectedArt([index])
Description
Section titled “Description”Resizes the artboard at the given index to fit currently selected art. Index default is 0. Returns true
on success.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
index | Number (long), optional | Artboard index to resize |
Returns
Section titled “Returns”Boolean.
Document.getPageItemFromUuid()
Section titled “Document.getPageItemFromUuid()”app.activeDocument.getPageItemFromUuid(uuid)
Description
Section titled “Description”Retrieves the PageItem using its Uuid.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
uuid | String | uuid of item to fetch |
Returns
Section titled “Returns”Document.getPerspectiveActivePlane()
Section titled “Document.getPerspectiveActivePlane()”app.activeDocument.getPerspectiveActivePlane()
Description
Section titled “Description”Retrieves the active plane of the active perspective grid of the document.
Returns
Section titled “Returns”Document.hidePerspectiveGrid()
Section titled “Document.hidePerspectiveGrid()”app.activeDocument.hidePerspectiveGrid()
Description
Section titled “Description”Hides the current active grid for the document. If no grid is visible, does nothing.
Returns true
if a grid is hidden.
Returns
Section titled “Returns”Boolean.
Document.imageCapture()
Section titled “Document.imageCapture()”app.activeDocument.imageCapture(imageFile [,clipBounds] [,options])
Description
Section titled “Description”Captures the artwork content within the clipping boundaries in this document as a raster image, and writes the image data to a specified file.
If the bounds parameter is omitted, captures the entire artwork.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
imageFile File object | Image file to write to | |
clipBounds | Rect, optional | Clipping bounds |
options | ImageCaptureOptions, optional | todo |
Returns
Section titled “Returns”Nothing.
Document.importCharacterStyles()
Section titled “Document.importCharacterStyles()”app.activeDocument.importCharacterStyles(fileSpec)
Description
Section titled “Description”Loads the character styles from the Illustrator file.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
fileSpec File object | File to load character styles from |
Returns
Section titled “Returns”Nothing.
Document.importParagraphStyles()
Section titled “Document.importParagraphStyles()”app.activeDocument.importParagraphStyles(fileSpec)
Description
Section titled “Description”Loads the paragraph styles from the Illustrator file.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
fileSpec | File object | File to load paragraph styles from |
Returns
Section titled “Returns”Nothing.
Document.importPDFPreset()
Section titled “Document.importPDFPreset()”app.activeDocument.importPDFPreset(fileSpec [, replacingPreset])
Description
Section titled “Description”Loads all PDF presets from a file.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
fileSpec | File object | File to load PDF presets from |
replacingPreset | String, optional | Whether to replace existing presets |
Returns
Section titled “Returns”Nothing.
Document.importPrintPreset()
Section titled “Document.importPrintPreset()”app.activeDocument.importPrintPreset(printPreset, fileSpec)
Description
Section titled “Description”Loads the named print preset from the file.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
printPreset | String | Name of preset to load |
fileSpec | File object | File to load print presets from |
Returns
Section titled “Returns”Nothing.
Document.importVariables()
Section titled “Document.importVariables()”app.activeDocument.importVariables(fileSpec)
Description
Section titled “Description”Imports a library containing datasets, variables, and their associated dynamic data. Importing variables overwrites existing variables and datasets.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
fileSpec | File object | File to import variables from |
Returns
Section titled “Returns”Nothing.
Document.print()
Section titled “Document.print()”app.activeDocument.print([options])
Description
Section titled “Description”Prints the document.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
options | PrintOptions, optional | todo |
Returns
Section titled “Returns”Nothing.
Document.rasterize()
Section titled “Document.rasterize()”app.activeDocument.rasterize(sourceArt [, clipBounds] [, options])
Description
Section titled “Description”Rasterizes the source art(s) within the specified clip bounds. The source art(s) is disposed of as a result of the rasterization.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
sourceArt | Variable | Source art to rasterize |
clipBounds | Rect, optional | Clipping bounds |
options | RasterizeOptions, optional | todo |
Returns
Section titled “Returns”Document.rearrangeArboards()
Section titled “Document.rearrangeArboards()”app.activeDocument.rearrangeArboards([artboardLayout] [, artboardRowsOrCols] [, artboardSpacing] [, artboardMoveArtwork])
Description
Section titled “Description”Rearranges artboards in the document. All arguments are optional.
Default layout style is DocumentArtboard Layout.GridByRow
.
The second argument specifies the number of rows or columns, as appropriate for the chosen layout style, in the range 1..docNumArtboards-1
, or 1 (the default) for single row/column layouts.
Spacing is a number of pixels, default 20.
When last argument is true (the default), artwork is moved with the artboards.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
artboardLayout | DocumentArtboardLayout, optional | Artboard layout |
artboardRowsOrCols | Integer, optional | Number of rows or columns |
artboardSpacing | Number, optional | Number of pixels for spacing |
artboardMoveArtwork | Boolean, optional | Whether to move artwork with the artboards |
Returns
Section titled “Returns”Boolean.
Document.save()
Section titled “Document.save()”app.activeDocument.save()
Description
Section titled “Description”Saves the document in it current location.
Returns
Section titled “Returns”Nothing.
Document.saveAs()
Section titled “Document.saveAs()”app.activeDocument.saveAs(saveIn [, options])
Description
Section titled “Description”Saves the document in the specified file as an Illustrator, EPS, or PDF file.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
saveIn | File object | File to save the document as |
options | SaveOptions, optional | Save options to close with |
Returns
Section titled “Returns”Nothing.
Document.saveNoUI()
Section titled “Document.saveNoUI()”app.activeDocument.saveNoUI(saveIn)
Description
Section titled “Description”Saves the non-UI document at the specified path
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
saveIn | File object | File to save the document as |
Returns
Section titled “Returns”Nothing.
Document.selectObjectsOnActiveArtboard()
Section titled “Document.selectObjectsOnActiveArtboard()”app.activeDocument.selectObjectsOnActiveArtboard()
Description
Section titled “Description”Selects the objects on the currently active artboard. Returns true
on success.
Returns
Section titled “Returns”Boolean.
Document.setActivePlane()
Section titled “Document.setActivePlane()”app.activeDocument.setActivePlane(gridPlane)
Description
Section titled “Description”Sets the active plane of the active perspective grid of the document. Returns true
on success.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
gridPlane | PerspectiveGridPlaneType | Grid plane type |
Returns
Section titled “Returns”Boolean.
Document.selectPerspectivePreset()
Section titled “Document.selectPerspectivePreset()”app.activeDocument.selectPerspectivePreset(gridType, presetName)
Description
Section titled “Description”Selects a predefined preset to define grid for the current document. Returns true
on success.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
gridType | PerspectiveGridType | Grid type |
presetName | String | Preset name to select |
Returns
Section titled “Returns”Boolean.
Document.showPerspectiveGrid()
Section titled “Document.showPerspectiveGrid()”app.activeDocument.showPerspectiveGrid()
Description
Section titled “Description”Shows the current active grid for the document, or if no grid is active, shows the default grid. Returns true
on success.
Returns
Section titled “Returns”Boolean.
Document.windowCapture()
Section titled “Document.windowCapture()”app.activeDocument.windowCapture(imageFile, windowSize)
Description
Section titled “Description”Captures the current document window to the target TIFF image file.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
imageFile | File object | Image file to save as |
windowSize | Array of 2 numbers | Window size |
Returns
Section titled “Returns”Nothing.
Example
Section titled “Example”Deselecting all objects in the current document
Section titled “Deselecting all objects in the current document”var docRef = activeDocument;docRef.selection = null;
Closing a document
Section titled “Closing a document”// Closes the active document without saving changesif ( app.documents.length > 0 ) { var aiDocument = app.activeDocument; aiDocument.close( SaveOptions.DONOTSAVECHANGES ); aiDocument = null;}
Creating a document with defaults
Section titled “Creating a document with defaults”// Creates a new document if none exists then sets fill and stroke defaults to truevar doc;if (app.documents.length == 0) { doc = app.documents.add();} else { doc = app.activeDocument;}
doc.defaultFilled = true;doc.defaultStroked = true;