InDesign Server2025
API 20.5.0.49
Object

Layer

A layer.

Hierarchy

Document

Layer

Properties

NameType AccessDescription
Graphic[] readonly Lists all graphics contained by the Layer.
PageItem[] readonly Lists all page items contained by the Layer.
Buttons<Button> readonly A collection of buttons.
CheckBoxes<CheckBox> readonly A collection of checkboxes.
ComboBoxes<ComboBox> readonly A collection of comboboxes.
EndnoteTextFrames<EndnoteTextFrame> readonly A collection of endnote text frames.
EPSTexts<EPSText> readonly EPSTexts
EventListeners<EventListener> readonly A collection of event listeners.
Events<Event> readonly A collection of events.
FormFields<FormField> readonly A collection of form fields.
GraphicLines<GraphicLine> readonly A collection of graphic lines.
Groups<Group> readonly A collection of groups.
Guides<Guide> readonly A collection of guides.
Number readonly The unique ID of the Layer.
Boolean read/write If true, text wrap settings applied to objects on the layer will not affect text on other layers when the layer is hidden.
Number readonly The index of the Layer within its containing object.
Boolean readonly Returns true if the object specifier resolves to valid objects.
String read/write A property that can be set to any string.
3 Reals (0 - 255)[] | UIColors[]
+25 more
read/write The 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.
ListBoxes<ListBox> readonly A collection of listboxes.
Boolean read/write If true, the guide positions on the layer are locked.
Boolean read/write If true, the Layer is locked.
MultiStateObjects<MultiStateObject> readonly A collection of multi-state objects.
String read/write The name of the Layer.
Ovals<Oval> readonly A collection of ellipses.
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.
Document readonly The parent of the Layer (a Document).
Polygons<Polygon> readonly A collection of polygons.
Boolean read/write If true, the layer will print.
Object read/write A property that allows setting of several properties at the same time.
RadioButtons<RadioButton> readonly A collection of radio buttons.
Rectangles<Rectangle> readonly A collection of rectangles.
Boolean read/write If true, guides are visible on the layer.
SignatureFields<SignatureField> readonly A collection of signature fields.
SplineItems<SplineItem> readonly The spline items collection.
TextBoxes<TextBox> readonly A collection of text boxes.
TextFrames<TextFrame> readonly A collection of text frames.
Boolean read/write If true, the Layer is visible.

Methods

EventListener

Adds an event listener.

eventType String The event type.
handler File | JavaScriptFunction The event handler. Can accept: File or JavaScript Function.
captures? Boolean This parameter is obsolete.
Layer

Duplicates the Layer.

String

Gets the label value associated with the specified key.

key String The key.
Layer[]

Resolves the object specifier, creating an array of object references.

void

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

key String The key.
value String The value.
Layer

Merges the layer with other layer(s).

with Layer[] The layer(s) with which to merge.
Layer

Moves the Layer to the specified location.

to LocationOptions The location relative to the reference object or within the containing object.
reference? Layer The reference object. Note: Required when the to value specifies before or after.
void

Deletes the Layer.

Boolean

Removes the event listener.

eventType String The registered event type.
handler File | JavaScriptFunction The registered event handler. Can accept: File or JavaScript Function.
captures? Boolean This parameter is obsolete.
String

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

String

Retrieves the object specifier.

Object of 36

Properties elsewhere that hold a Layer.

Parameter of 100

Method parameters that accept a Layer.

Button.duplicate(to)Button.move(to)Buttons.add(layer)CheckBox.duplicate(to)CheckBox.move(to)CheckBoxes.add(layer)ComboBox.duplicate(to)ComboBox.move(to)ComboBoxes.add(layer)Document.createFromMathML(destinationLayer)Document.createTOC(destinationLayer)EPS.duplicate(to)EPS.move(to)EPSText.duplicate(to)EPSText.move(to)EndnoteTextFrame.duplicate(to)EndnoteTextFrame.move(to)EndnoteTextFrames.add(layer)FormField.duplicate(to)FormField.move(to)FormFields.add(layer)Graphic.duplicate(to)Graphic.move(to)GraphicLine.duplicate(to)GraphicLine.move(to)GraphicLines.add(layer)Group.duplicate(to)Group.move(to)Groups.add(layer)Guides.add(layer)HtmlItem.duplicate(to)HtmlItem.move(to)HtmlItems.add(layer)Image.duplicate(to)Image.move(to)ImportedPage.duplicate(to)ImportedPage.move(to)Index_.generate(destinationLayer)Layer.merge(with)Layer.move(reference)Layers.itemByRange(from)Layers.nextItem(obj)Layers.previousItem(obj)ListBox.duplicate(to)ListBox.move(to)ListBoxes.add(layer)MasterSpread.contentPlace(destinationLayer)MasterSpread.createGuides(layer)MasterSpread.place(destinationLayer)MasterSpread.placeAndLink(destinationLayer)MathObjects.add(destinationLayer)MediaItem.duplicate(to)MediaItem.move(to)Movie.move(to)Movies.add(layer)MultiStateObject.duplicate(to)MultiStateObject.move(to)MultiStateObjects.add(layer)Oval.duplicate(to)Oval.move(to)Ovals.add(layer)PDF.duplicate(to)PDF.move(to)PICT.duplicate(to)PICT.move(to)Page.contentPlace(destinationLayer)Page.place(destinationLayer)Page.placeAndLink(destinationLayer)PageItem.duplicate(to)PageItem.move(to)Polygon.duplicate(to)Polygon.move(to)Polygons.add(layer)RadioButton.duplicate(to)RadioButton.move(to)RadioButtons.add(layer)Rectangle.duplicate(to)Rectangle.move(to)Rectangles.add(layer)SVG.duplicate(to)SVG.move(to)SignatureField.duplicate(to)SignatureField.move(to)SignatureFields.add(layer)Sound.move(to)Sounds.add(layer)SplineItem.duplicate(to)SplineItem.move(to)Spread.contentPlace(destinationLayer)Spread.createGuides(layer)Spread.place(destinationLayer)Spread.placeAndLink(destinationLayer)TextBox.duplicate(to)TextBox.move(to)TextBoxes.add(layer)TextFrame.duplicate(to)TextFrame.move(to)TextFrames.add(layer)WMF.duplicate(to)WMF.move(to)

Return 17

Methods that return a Layer.