Adobe InDesign CS6 (8.0) Object Model JS: Layer

InDesign CS6

Class

Layer

 A layer.

QuickLinks

addEventListener, duplicate, extractLabel, getElements, insertLabel, merge, move, remove, removeEventListener, toSource, toSpecifier

Hierarchy

Document
Layer
Event | EventListener | MutationEvent

Properties

PropertyTypeAccessDescription
allGraphicsArray of Graphic readonlyLists all graphics contained by the Layer.
allPageItemsArray of PageItem readonlyLists all page items contained by the Layer.
buttonsButtons readonlyA collection of buttons.
checkBoxesCheckBoxes readonlyA collection of checkboxes.
comboBoxesComboBoxes readonlyA collection of comboboxes.
epstextsEPSTexts readonlyEPSTexts
eventListenersEventListeners readonlyA collection of event listeners.
eventsEvents readonlyA collection of events.
formFieldsFormFields readonlyA collection of form fields.
graphicLinesGraphicLines readonlyA collection of graphic lines.
groupsGroups readonlyA collection of groups.
guidesGuides readonlyA collection of guides.
idnumber readonlyThe unique ID of the Layer.
ignoreWrapbool r/wIf true, text wrap settings applied to objects on the layer will not affect text on other layers when the layer is hidden.
indexnumber readonlyThe index of the Layer within its containing object.
isValidbool readonlyReturns true if the object specifier resolves to valid objects.
labelstring r/wA property that can be set to any string.
layerColor3 Reals (0 - 255)
UIColors
r/wThe color of the layer, specified either as an array of three doubles, each in the range 0 to 255 and representing R, G, and B values, or as a UI color. Can return: Array of 3 Reals (0 - 255) or UIColors enumerator.
listBoxesListBoxes readonlyA collection of listboxes.
lockGuidesbool r/wIf true, the guide positions on the layer are locked.
lockedbool r/wIf true, the Layer is locked.
multiStateObjectsMultiStateObjects readonlyA collection of multi-state objects.
namestring r/wThe name of the Layer.
ovalsOvals readonlyA collection of ellipses.
pageItemsPageItems readonlyThe 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.
parentDocument readonlyThe parent of the Layer (a Document).
polygonsPolygons readonlyA collection of polygons.
printablebool r/wIf true, the layer will print.
propertiesObject r/wA property that allows setting of several properties at the same time.
radioButtonsRadioButtons readonlyA collection of radio buttons.
rectanglesRectangles readonlyA collection of rectangles.
showGuidesbool r/wIf true, guides are visible on the layer.
signatureFieldsSignatureFields readonlyA collection of signature fields.
splineItemsSplineItems readonlyThe spline items collection.
textBoxesTextBoxes readonlyA collection of text boxes.
textFramesTextFrames readonlyA collection of text frames.
visiblebool r/wIf true, the Layer is visible.

Methods

Instances

EventListener addEventListener (eventType: string, handler: varies[, captures: bool=false])
Adds an event listener.

ParameterTypeDescription
eventTypestringThe event type.
handlerFile
JavaScript Function
The event handler. Can accept: File or JavaScript Function.
capturesboolThis parameter is obsolete. (Optional) (default: false)

Layer duplicate ()
Duplicates the Layer.

string extractLabel (key: string)
Gets the label value associated with the specified key.

ParameterTypeDescription
keystringThe key.

Array of Layer getElements ()
Resolves the object specifier, creating an array of object references.

void insertLabel (key: string, value: string)
Sets the label to the value associated with the specified key.

ParameterTypeDescription
keystringThe key.
valuestringThe value.

Layer merge (with: Array of Layer)
Merges the layer with other layer(s).

ParameterTypeDescription
withArray of LayerThe layer(s) with which to merge.

Layer move (to: LocationOptions[, reference: Layer])
Moves the Layer to the specified location.

ParameterTypeDescription
toLocationOptions:
LocationOptions.BEFORE
LocationOptions.AFTER
LocationOptions.AT_END
LocationOptions.AT_BEGINNING
LocationOptions.UNKNOWN
The location relative to the reference object or within the containing object.
referenceLayerThe reference object. Note: Required when the to value specifies before or after. (Optional)

void remove ()
Deletes the Layer.

bool removeEventListener (eventType: string, handler: varies[, captures: bool=false])
Removes the event listener.

ParameterTypeDescription
eventTypestringThe registered event type.
handlerFile
JavaScript Function
The registered event handler. Can accept: File or JavaScript Function.
capturesboolThis parameter is obsolete. (Optional) (default: false)

string toSource ()
Generates a string which, if executed, will return the Layer.

string toSpecifier ()
Retrieves the object specifier.

Element of

Button.itemLayer

CheckBox.itemLayer

ComboBox.itemLayer

Document.activeLayer

EPS.itemLayer

EPSText.itemLayer

FormField.itemLayer

Graphic.itemLayer

GraphicLine.itemLayer

Group.itemLayer

Guide.itemLayer

HtmlItem.itemLayer

Image.itemLayer

ImportedPage.itemLayer

LayoutWindow.activeLayer

ListBox.itemLayer

MediaItem.itemLayer

Movie.itemLayer

MultiStateObject.itemLayer

Oval.itemLayer

PDF.itemLayer

PICT.itemLayer

PageItem.itemLayer

Polygon.itemLayer

RadioButton.itemLayer

Rectangle.itemLayer

SignatureField.itemLayer

Sound.itemLayer

SplineItem.itemLayer

TextBox.itemLayer

TextFrame.itemLayer

WMF.itemLayer

Used in:

Button Buttons.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

CheckBox CheckBoxes.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

ComboBox ComboBoxes.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

array of Story Document.createTOC (using: TOCStyle[, replacing: bool=false][, fromBook: Book][, placePoint: Array of Measurement Unit (Number or String)][, includeOverset: bool=false][, destinationLayer: Layer])

FormField FormFields.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

GraphicLine GraphicLines.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

Group Groups.add (groupItems: Array of PageItem[, layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

Guide Guides.add ([layer: Layer][, withProperties: Object])

HtmlItem HtmlItems.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

array of Story Index.generate ([on: varies][, placePoint: Array of Measurement Unit (Number or String)][, destinationLayer: Layer][, autoflowing: bool=false][, includeOverset: bool=false])

Layer Layer.merge (with: Array of Layer)

Layer Layer.move (to: LocationOptions[, reference: Layer])

Layer Layers.nextItem (obj: Layer)

Layer Layers.previousItem (obj: Layer)

ListBox ListBoxes.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

array of varies=any MasterSpread.contentPlace (pageItems: Array of PageItem[, linkPageItems: bool=false][, linkStories: bool=false][, mapStyles: bool=false][, placePoint: Array of Measurement Unit (Number or String)][, destinationLayer: Layer][, showingOptions: bool=false])

void MasterSpread.createGuides ([numberOfRows: number=0][, numberOfColumns: number=0][, rowGutter: Measurement Unit (Number or String)=0][, columnGutter: Measurement Unit (Number or String)=0][, guideColor: varies][, fitMargins: bool=false][, removeExisting: bool=false][, layer: Layer])

array of varies=any MasterSpread.place (fileName: File[, placePoint: Array of Measurement Unit (Number or String)][, destinationLayer: Layer][, showingOptions: bool=false][, autoflowing: bool=false][, withProperties: Object])

Story MasterSpread.placeAndLink (parentStory: Story[, placePoint: Array of Measurement Unit (Number or String)][, destinationLayer: Layer][, showingOptions: bool=false])

Movie Movies.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

MultiStateObject MultiStateObjects.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

Oval Ovals.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

array of varies=any Page.contentPlace (pageItems: Array of PageItem[, linkPageItems: bool=false][, linkStories: bool=false][, mapStyles: bool=false][, placePoint: Array of Measurement Unit (Number or String)][, destinationLayer: Layer][, showingOptions: bool=false])

array of varies=any Page.place (fileName: File[, placePoint: Array of Measurement Unit (Number or String)][, destinationLayer: Layer][, showingOptions: bool=false][, autoflowing: bool=false][, withProperties: Object])

Story Page.placeAndLink (parentStory: Story[, placePoint: Array of Measurement Unit (Number or String)][, destinationLayer: Layer][, showingOptions: bool=false])

Polygon Polygons.add ([layer: Layer][, numberOfSides: number][, insetPercentage: number][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

RadioButton RadioButtons.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

Rectangle Rectangles.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

SignatureField SignatureFields.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

Sound Sounds.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

array of varies=any Spread.contentPlace (pageItems: Array of PageItem[, linkPageItems: bool=false][, linkStories: bool=false][, mapStyles: bool=false][, placePoint: Array of Measurement Unit (Number or String)][, destinationLayer: Layer][, showingOptions: bool=false])

void Spread.createGuides ([numberOfRows: number=0][, numberOfColumns: number=0][, rowGutter: Measurement Unit (Number or String)=0][, columnGutter: Measurement Unit (Number or String)=0][, guideColor: varies][, fitMargins: bool=false][, removeExisting: bool=false][, layer: Layer])

array of varies=any Spread.place (fileName: File[, placePoint: Array of Measurement Unit (Number or String)][, destinationLayer: Layer][, showingOptions: bool=false][, autoflowing: bool=false][, withProperties: Object])

Story Spread.placeAndLink (parentStory: Story[, placePoint: Array of Measurement Unit (Number or String)][, destinationLayer: Layer][, showingOptions: bool=false])

TextBox TextBoxes.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

TextFrame TextFrames.add ([layer: Layer][, at: LocationOptions=LocationOptions.UNKNOWN][, reference: varies][, withProperties: Object])

Return

Layer Layer.duplicate ()

Array of Layer Layer.getElements ()

Layer Layer.merge (with: Array of Layer)

Layer Layer.move (to: LocationOptions[, reference: Layer])

Layer Layers.[] (index: number)

Layer Layers.add ([withProperties: Object])

Layer Layers.anyItem ()

Array of Layer Layers.everyItem ()

Layer Layers.firstItem ()

Layer Layers.item (index: varies)

Layer Layers.itemByID (id: number)

Layer Layers.itemByName (name: string)

Array of Layer Layers.itemByRange (from: varies, to: varies)

Layer Layers.lastItem ()

Layer Layers.middleItem ()

Layer Layers.nextItem (obj: Layer)

Layer Layers.previousItem (obj: Layer)

Jongware, 28-Apr-2012 v3.0.3hContents :: Index