Document

A document.

Methods:

autoStyle, autoTag, close, createTOC, deleteUnusedTags, exportFile, extractLabel, importDtd, importStyles, importXML, insertLabel, loadXMLTags, packageForGoLive, packageForPrint, print, redo, save, saveXMLTags, search, select, undo

Objects:

Bookmarks, Boolean, ButtonPreference, Buttons, CharacterStyles, Colors, DTDs, DashedStrokeStyles, DataMerge, DictionaryPreference, DocumentPreference, DottedStrokeStyles, File, Fonts, FormFields, GalleyPreference, Gradients, Graphic, GraphicLines, GridPreference, Groups, GuidePreference, Guides, HyperlinkExternalPageDestinations, HyperlinkPageDestinations, HyperlinkPageItemSources, HyperlinkTextDestinations, HyperlinkTextSources, HyperlinkURLDestinations, Hyperlinks, HyphenationExceptions, IndexOptions, Indexes, Inks, Languages, Layers, LayoutAdjustmentPreference, LayoutWindows, Links, MarginPreference, MasterSpreads, MetadataPreference, MixedInkGroups, MixedInks, NothingEnum, Number, Object, Ovals, PackageForGoLivePreference, PageItem, PageItems, Pages, ParagraphStyles, PasteboardPreference, PolygonPreference, Polygons, PrintPreference, Rectangles, RenderingIntent, Sections, Spreads, Stories, StoryPreference, StoryWindows, String, StripedStrokeStyles, StrokeStyles, Swatch, Swatches, TOCStyles, TextDefault, TextFramePreference, TextFrames, TextPreference, Tints, TransparencyPreference, TrapPresets, ValidationErrors, ViewPreference, Windows, XMLComments, XMLElement, XMLElements, XMLExportMaps, XMLExportPreference, XMLImportMaps, XMLImportPreference, XMLInstructions, XMLItems, XMLTags, XMLViewPreference

Preferences:

ButtonPreference, DictionaryPreference, DocumentPreference, GalleyPreference, GridPreference, GuidePreference, HyphenationExceptions, IndexOptions, LayoutAdjustmentPreference, MarginPreference, MetadataPreference, PackageForGoLivePreference, PasteboardPreference, PolygonPreference, PrintPreference, StoryPreference, TextFramePreference, TextPreference, TransparencyPreference, ViewPreference, XMLExportPreference, XMLImportPreference, XMLViewPreference

Property Listing

Property

Type

Access

Description

afterBlendingIntent

RenderingIntent

RenderingIntent.ABSOLUTE_COLORIMETRIC

RenderingIntent.PERCEPTUAL

RenderingIntent.RELATIVE_COLORIMETRIC

RenderingIntent.SATURATION

RenderingIntent.USE_COLOR_SETTINGS

read/write

The rendering intent for colors that result from transparency interactions on the page after blending.

allGraphics

Array of Graphic

readonly

Lists all graphics contained by the Document.

allPageItems

Array of PageItem

readonly

Lists all page items contained by the Document.

associatedXMLElement

XMLElement

readonly

Returns the associated XML element

bookmarks

Bookmarks Bookmark

readonly

A collection of bookmarks.

buttonPreferences

ButtonPreference

readonly

Button preference settings.

buttons

Buttons Button

readonly

A collection of buttons.

characterStyles

CharacterStyles CharacterStyle

readonly

A collection of character styles.

cmykProfile

String

read/write

The current CMYK profile.

cmykProfileList

Array of String

readonly

A list of valid CMYK profiles.

colors

Colors Color

readonly

A collection of colors.

dashedStrokeStyles

DashedStrokeStyles DashedStrokeStyle

readonly

A collection of dashed stroke styles.

dataMergeProperties

DataMerge

readonly

Data merge properties that define data merge fields and preferences.

defaultImageIntent

RenderingIntent

RenderingIntent.ABSOLUTE_COLORIMETRIC

RenderingIntent.PERCEPTUAL

RenderingIntent.RELATIVE_COLORIMETRIC

RenderingIntent.SATURATION

RenderingIntent.USE_COLOR_SETTINGS

read/write

The rendering intent for bitmap images.

dictionaryPreferences

DictionaryPreference

readonly

User dictionary preference settings.

documentPreferences

DocumentPreference

readonly

Document preference settings.

dottedStrokeStyles

DottedStrokeStyles DottedStrokeStyle

readonly

A collection of dotted stroke styles.

dtds

DTDs DTD

readonly

A collection of DTDs.

filePath

File

readonly

The full path to the file.

fonts

Fonts Font

readonly

A collection of fonts.

formFields

FormFields FormField

readonly

A collection of form fields.

fullName

File

readonly

The full path to the Document, including the name of the Document.

galleyPreferences

GalleyPreference

readonly

Galley preference settings.

gradients

Gradients Gradient

readonly

A collection of gradients.

graphicLines

GraphicLines GraphicLine

readonly

A collection of graphic lines.

gridPreferences

GridPreference

readonly

Grid preference settings.

groups

Groups Group

readonly

A collection of groups.

guidePreferences

GuidePreference

readonly

Guide preference settings.

guides

Guides Guide

readonly

A collection of guides.

hyperlinkExternalPageDestinations

HyperlinkExternalPageDestinations HyperlinkExternalPageDestination

readonly

A collection of hyperlink external page destinations.

hyperlinkPageDestinations

HyperlinkPageDestinations HyperlinkPageDestination

readonly

A collection of hyperlink page destinations.

hyperlinkPageItemSources

HyperlinkPageItemSources HyperlinkPageItemSource

readonly

A collection of hyperlink page item sources.

hyperlinkTextDestinations

HyperlinkTextDestinations HyperlinkTextDestination

readonly

A collection of hyperlink text destinations.

hyperlinkTextSources

HyperlinkTextSources HyperlinkTextSource

readonly

A collection of hyperlink text sources.

hyperlinkURLDestinations

HyperlinkURLDestinations HyperlinkURLDestination

readonly

A collection of hyperlink URL destinations.

hyperlinks

Hyperlinks Hyperlink

readonly

A collection of hyperlinks.

hyphenationExceptions

HyphenationExceptions HyphenationException

readonly

A collection of hyphenation exceptions lists.

index

Number

readonly

The index of the Document within its containing object.

indexGenerationOptions

IndexOptions

readonly

The index options properties that define how an index is formatted.

indexes

Indexes

readonly

A collection of indexes.

inks

Inks Ink

readonly

A collection of inks.

label

String

read/write

A property that can be set to any string.

languages

Languages Language

readonly

A collection of languages.

layers

Layers Layer

readonly

A collection of layers.

layoutAdjustmentPreferences

LayoutAdjustmentPreference

readonly

Layout sdjustment preference settings.

layoutWindows

LayoutWindows LayoutWindow

readonly

A collection of layout windows.

links

Links Link

readonly

A collection of links.

marginPreferences

MarginPreference

readonly

Margin preference settings.

masterSpreads

MasterSpreads MasterSpread

readonly

A collection of master spreads.

metadataPreferences

MetadataPreference

readonly

Metadata preference settings.

mixedInkGroups

MixedInkGroups MixedInkGroup

readonly

A collection of mixed ink groups.

mixedInks

MixedInks MixedInk

readonly

A collection of mixed inks.

modified

Boolean

readonly

If true, the Document has been modified since it was last saved.

name

String

readonly

The name of the Document.

ovals

Ovals Oval

readonly

A collection of ellipses.

packageForGoLivePreferences

PackageForGoLivePreference

readonly

The Package For GoLive preference properties that define how a document is packaged for GoLive.

pageItems

PageItems PageItem

readonly

The page items collection, which can be used to process all page items in a container (such as a document, page, or group), regardless of type.

pages

Pages Page

readonly

A collection of pages.

paragraphStyles

ParagraphStyles ParagraphStyle

readonly

A collection of paragraph styles.

parent

Application

readonly

The parent of the Document (a Application).

pasteboardPreferences

PasteboardPreference

readonly

Pasteboard preference settings.

polygonPreferences

PolygonPreference

readonly

Polygon preference properties to use to define default settings for creating a polygon.

polygons

Polygons Polygon

readonly

A collection of polygons.

printPreferences

PrintPreference

readonly

Print preference settings.

properties

Object

read/write

A property that allows setting of several properties at the same time.

rectangles

Rectangles Rectangle

readonly

A collection of rectangles.

redoName

String

readonly

The name of the action on the top of the redo stack.

rgbProfile

String

read/write

The current RGB profile.

rgbProfileList

Array of String

readonly

A list of valid RGB profiles.

saved

Boolean

readonly

If true, the Document has been saved since it was created.

sections

Sections Section

readonly

A collection of sections.

selection

Array of Objects

Object

NothingEnum.NOTHING

read/write

The selection. Can return: Object, Array of Objects or NothingEnum enumerator.

solidColorIntent

RenderingIntent

RenderingIntent.ABSOLUTE_COLORIMETRIC

RenderingIntent.PERCEPTUAL

RenderingIntent.RELATIVE_COLORIMETRIC

RenderingIntent.SATURATION

RenderingIntent.USE_COLOR_SETTINGS

read/write

The rendering intent for all vector art (areas of solid color) in native objects.

spreads

Spreads Spread

readonly

A collection of spreads.

stories

Stories Story

readonly

A collection of stories.

storyPreferences

StoryPreference

readonly

Story preference settings.

storyWindows

StoryWindows StoryWindow

readonly

A collection of story windows.

stripedStrokeStyles

StripedStrokeStyles StripedStrokeStyle

readonly

A collection of striped stroke styles.

strokeStyles

StrokeStyles StrokeStyle

readonly

A collection of stroke styles.

swatches

Swatches

readonly

A collection of swatches.

textDefaults

TextDefault

readonly

Text default settings.

textFramePreferences

TextFramePreference

readonly

Text frame preference settings.

textFrames

TextFrames TextFrame

readonly

A collection of text frames.

textPreferences

TextPreference

readonly

Text preference settings.

tints

Tints Tint

readonly

A collection of tints.

tocStyles

TOCStyles TOCStyle

readonly

A collection of TOC styles.

transparencyPreferences

TransparencyPreference

readonly

Transparency preference settings.

trapPresets

TrapPresets TrapPreset

readonly

A collection of trap presets.

undoName

String

readonly

The name of the action on the top of the undo stack.

unusedSwatches

Array of Swatch

readonly

The swatches that are not being used.

validationErrors

ValidationErrors ValidationError

readonly

A collection of XML validation errors.

viewPreferences

ViewPreference

readonly

View preference settings.

visible

Boolean

readonly

If true, the Document is visible.

windows

Windows Window

readonly

A collection of windows.

xmlComments

XMLComments XMLComment

readonly

A collection of XML comments.

xmlElements

XMLElements XMLElement

readonly

A collection of XML elements.

xmlExportMaps

XMLExportMaps XMLExportMap

readonly

A collection of XML export maps.

xmlExportPreferences

XMLExportPreference

readonly

XML export preference settings.

xmlImportMaps

XMLImportMaps XMLImportMap

readonly

A collection of XML import maps.

xmlImportPreferences

XMLImportPreference

readonly

XML import preference settings.

xmlInstructions

XMLInstructions XMLInstruction

readonly

A collection of XML instructions.

xmlItems

XMLItems XMLItem

readonly

A collection of XML items.

xmlTags

XMLTags XMLTag

readonly

A collection of XML tags.

xmlViewPreferences

XMLViewPreference

readonly

XML view preference settings.

zeroPoint

Array of Number

Array of String

read/write

The ruler origin, specified as page coordinates in the format [x, y].

Method Listing

undefined autoStyle ()

Auto styles the document based on the tag-to-style map.

undefined autoTag ()

Auto tags the document based on the style-to-tag map.

undefined close ([saving:SaveOptions=SaveOptions], savingIn:File)

Closes the Document.

Parameter

Type

Description

saving

SaveOptions

SaveOptions.ASK

SaveOptions.NO

SaveOptions.YES

The option for saving changes. (Optional)

(default: SaveOptions.ASK)

savingIn

File

The file path of the saved document. Note: Required only when saving the document for the first time. If the document has previously been saved, specifying a path saves a copy and closes the original document. (Optional)

TextFrame createTOC (using:TOCStyle, [replacing:Boolean=Boolean], fromBook:Book, placePoint:Array of Number String, [includeOverset:Boolean=Boolean], destinationLayer:Layer)

Create a table of contents for a document or book

Parameter

Type

Description

using

TOCStyle

The table of content style to use

replacing

Boolean

Whether to replace the existing TOC (Optional)

(default: false)

fromBook

Book

The book from which to create the TOC (Optional)

placePoint

Array of Number

Array of String

The point at which to place the TOC (Optional)

includeOverset

Boolean

Whether to include overset text in the TOC (Optional)

(default: false)

destinationLayer

Layer

The layer on which to place the TOC (Optional)

undefined deleteUnusedTags ()

Deletes unused XML markup tags.

undefined exportFile (format:Varies ExportFormat String, to:File, [showingOptions:Boolean=Boolean], using:PDFExportPreset)

Exports the object(s) to a file.

Parameter

Type

Description

format

ExportFormat

ExportFormat.EPS_TYPE

ExportFormat.INCOPY

ExportFormat.JPG

ExportFormat.PDF_TYPE

ExportFormat.RTF

ExportFormat.SVG

ExportFormat.SVG_COMPRESSED

ExportFormat.TAGGED_TEXT

ExportFormat.TEXT_TYPE

ExportFormat.XML

String

The export format. Can accept: ExportFormat enumerator or String.

to

File

The path of the export file.

showingOptions

Boolean

If true, prompts the user to select export options. (Optional)

(default: false)

using

PDFExportPreset

The export style to use. (Optional)

String extractLabel (key:String)

Gets the label value associated with the specified key.

Parameter

Type

Description

key

String

The key.

undefined importDtd (from:File)

Imports a DTD to use for validation.

Parameter

Type

Description

from

File

The path to the DTD file.

undefined importStyles (format:ImportFormat, from:File)

Import styles.

Parameter

Type

Description

format

ImportFormat

ImportFormat.CHARACTER_STYLES_FORMAT

ImportFormat.PARAGRAPH_STYLES_FORMAT

ImportFormat.TEXT_STYLES_FORMAT

ImportFormat.TOC_STYLES_FORMAT

The type of styles to import.

from

File

an InDesign file to import from

undefined importXML (from:File)

Imports an XML file.

Parameter

Type

Description

from

File

The path to the XML file.

undefined insertLabel (key:String, value:String)

Sets the label to the value associated with the specified key.

Parameter

Type

Description

key

String

The key.

value

String

The value.

undefined loadXMLTags (from:File)

Loads a set of XML markup tags from the specified file.

Parameter

Type

Description

from

File

The path to the file that contains the tags.

Boolean packageForGoLive (location:File)

Packages for GoLive

Parameter

Type

Description

location

File

File location for package

Boolean packageForPrint (to:File, copyingFonts:Boolean, copyingLinkedGraphics:Boolean, copyingProfiles:Boolean, updatingGraphics:Boolean, includingHiddenLayers:Boolean, ignorePreflightErrors:Boolean, creatingReport:Boolean)

Packages the document for handoff to a service provider.

Parameter

Type

Description

to

File

The folder, alias, or path in which to place the packaged files.

copyingFonts

Boolean

If true, copies fonts used in the document to the package folder.

copyingLinkedGraphics

Boolean

If true, copies linked graphics files to the package folder.

copyingProfiles

Boolean

If true, copies color profiles to the package folder.

updatingGraphics

Boolean

If true, updates graphics links to the package folder.

includingHiddenLayers

Boolean

If true, copies fonts and links from hidden layers to the package.

ignorePreflightErrors

Boolean

If true, ignores preflight errors and proceeds with the packaging. If false, cancels the packaging when errors exist.

creatingReport

Boolean

If true, creates a package report that includes printing instructions, print settings, lists of fonts, links and required inks, and other information.

undefined print (printDialog:Boolean, using:Varies PrinterPresetTypes PrinterPreset)

Prints the Document(s).

Parameter

Type

Description

printDialog

Boolean

Whether to invoke the print dialog (Optional)

using

PrinterPresetTypes

PrinterPresetTypes.CUSTOM

PrinterPresetTypes.DEFAULT_VALUE

PrinterPreset

Printer preset to use. Can accept: PrinterPresetTypes enumerator or PrinterPreset. (Optional)

undefined redo ()

Redoes the last action.

undefined save (to:File, [stationery:Boolean=Boolean])

Save the document

Parameter

Type

Description

to

File

The file path. Note: Required only if the document has not been previously saved. If the document has previously been saved, specifying a path saves a copy and closes the original document. (Optional)

stationery

Boolean

If true, saves the file as stationery (Mac OS) or as a template (Windows). Note: The file extension for stationery and templates is different than the extension for regular files. (Optional)

(default: false)

undefined saveXMLTags (to:File)

Saves the XML markup tags as an XML file.

Parameter

Type

Description

to

File

The name and location of the XML file.

Text search (for:String, wholeWord:Boolean, caseSensitive:Boolean, replacingWith:String, withFindAttributes:Object, withChangeAttributes:Object)

Look for occurrences of text that matches specific criteria

Parameter

Type

Description

for

String

What to look for (Optional)

wholeWord

Boolean

If true, then disregard text embedded within a larger word (Optional)

caseSensitive

Boolean

If true, then search only for text that matches case (Optional)

replacingWith

String

What to replace the found text with, either a string or a special character (Optional)

withFindAttributes

Object

A record of find preference settings to use (Optional)

withChangeAttributes

Object

A record of change preference settings to use (Optional)

undefined select (selectableItems:Array of Varies Objects Object NothingEnum, [existingSelection:SelectionOptions=SelectionOptions])

Select one or more objects.

Parameter

Type

Description

selectableItems

Array of Objects

Object

NothingEnum.NOTHING

The object(s) to select. Can accept: Object, Array of Objects or NothingEnum enumerator.

existingSelection

SelectionOptions

SelectionOptions.ADD_TO

SelectionOptions.REMOVE_FROM

SelectionOptions.REPLACE

How to handle the existing selection (Optional)

(default: SelectionOptions.REPLACE)

undefined undo ()

Undoes the last action.

Object of

Book.styleSourceDocument

Application.activeDocument

Bookmark.parent

Button.parent

ButtonPreference.parent

CharacterStyle.parent

Color.parent

DTD.parent

DashedStrokeStyle.parent

DataMerge.parent

DictionaryPreference.parent

DocumentPreference.parent

DottedStrokeStyle.parent

Font.parent

FormField.parent

GalleyPreference.parent

Gradient.parent

GraphicLine.parent

GridPreference.parent

Group.parent

Guide.parent

GuidePreference.parent

Hyperlink.parent

HyperlinkExternalPageDestination.parent

HyperlinkPageDestination.parent

HyperlinkPageItemSource.parent

HyperlinkTextDestination.parent

HyperlinkTextSource.parent

HyperlinkURLDestination.parent

HyphenationException.parent

Index.parent

IndexOptions.parent

Ink.parent

Language.parent

Layer.parent

LayoutAdjustmentPreference.parent

LayoutWindow.parent

MarginPreference.parent

MasterSpread.parent

MetadataPreference.parent

MixedInk.parent

MixedInkGroup.parent

Oval.parent

PackageForGoLivePreference.parent

Page.parent

PageItem.parent

ParagraphStyle.parent

PasteboardPreference.parent

Polygon.parent

PolygonPreference.parent

PrintPreference.parent

Rectangle.parent

Section.parent

Spread.parent

Story.parent

StoryPreference.parent

StoryWindow.parent

StripedStrokeStyle.parent

StrokeStyle.parent

Swatch.parent

TOCStyle.parent

TextDefault.parent

TextFrame.parent

TextFramePreference.parent

TextPreference.parent

Tint.parent

TransparencyPreference.parent

TrapPreset.parent

ValidationError.parent

ViewPreference.parent

Window.parent

XMLComment.parent

XMLElement.parent

XMLExportMap.parent

XMLExportPreference.parent

XMLImportMap.parent

XMLImportPreference.parent

XMLInstruction.parent

XMLItem.parent

XMLTag.parent

XMLViewPreference.parent

Return

Documents.add()