Adobe InDesign CS6 Server (8.0) Object Model JS: Snippet

InDesign Server CS6

Class

Snippet

 An IDML snippet.

QuickLinks

addEventListener, extractLabel, getElements, insertLabel, remove, removeEventListener, toSource, toSpecifier

Hierarchy

PlaceGun
Snippet
Button | CheckBox | ComboBox | EPS | EPSText | Event | EventListener | FormField | Graphic | GraphicLine | Group | Image | ListBox | MultiStateObject | MutationEvent | Oval | PDF | PICT | PageItem | Polygon | RadioButton | Rectangle | SignatureField | SplineItem | TextBox | TextFrame | WMF

Properties

PropertyTypeAccessDescription
buttonsButtons Button readonlyA collection of buttons.
checkBoxesCheckBoxes readonlyA collection of checkboxes.
comboBoxesComboBoxes readonlyA collection of comboboxes.
epssEPSs EPS readonlyA collection of EPS files.
epstextsEPSTexts EPSText readonlyEPSTexts
eventListenersEventListeners EventListener readonlyA collection of event listeners.
eventsEvents Event readonlyA collection of events.
formFieldsFormFields FormField readonlyA collection of form fields.
graphicLinesGraphicLines GraphicLine readonlyA collection of graphic lines.
graphicsGraphics Graphic readonlyA collection of imported graphics in any graphic file format (vector, metafile, or bitmap).
groupsGroups Group readonlyA collection of groups.
idnumber readonlyThe unique ID of the Snippet.
imagesImages Image readonlyA collection of bitmap images in any bitmap file format (including TIFF, JPEG, or GIF).
indexnumber readonlyThe index of the Snippet 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.
listBoxesListBoxes readonlyA collection of listboxes.
multiStateObjectsMultiStateObjects MultiStateObject readonlyA collection of multi-state objects.
namestring r/wThe name of the Snippet; this is an alias to the Snippet's label property.
ovalsOvals Oval readonlyA collection of ellipses.
pageItemsPageItems PageItem 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.
parentPlaceGun readonlyThe parent of the Snippet (a PlaceGun).
pdfsPDFs PDF readonlyA collection of PDF files.
pictsPICTs PICT readonlyA collection of PICT graphics.
polygonsPolygons Polygon readonlyA collection of polygons.
propertiesObject r/wA property that allows setting of several properties at the same time.
radioButtonsRadioButtons RadioButton readonlyA collection of radio buttons.
rectanglesRectangles Rectangle readonlyA collection of rectangles.
signatureFieldsSignatureFields SignatureField readonlyA collection of signature fields.
splineItemsSplineItems SplineItem readonlyThe spline items collection.
textBoxesTextBoxes readonlyA collection of text boxes.
textFramesTextFrames TextFrame readonlyA collection of text frames.
wmfsWMFs WMF readonlyA collection of WMF graphics.

Class

PropertyTypeAccessDescription
BEFORE_PLACEstring readonlyDispatched before a Snippet is placed. This event bubbles. This event is cancelable. (default: beforePlace)

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)

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

ParameterTypeDescription
keystringThe key.

Array of Snippet 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.

void remove ()
Deletes the Snippet.

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 Snippet.

string toSpecifier ()
Retrieves the object specifier.

Element of

Button.parent

CheckBox.parent

ComboBox.parent

EPS.parent

EPSText.parent

FormField.parent

Graphic.parent

GraphicLine.parent

Group.parent

Image.parent

ListBox.parent

MultiStateObject.parent

Oval.parent

PDF.parent

PICT.parent

PageItem.parent

Polygon.parent

RadioButton.parent

Rectangle.parent

SignatureField.parent

SplineItem.parent

TextBox.parent

TextFrame.parent

WMF.parent

Used in:

Snippet Snippets.nextItem (obj: Snippet)

Snippet Snippets.previousItem (obj: Snippet)

Return

Array of Snippet Snippet.getElements ()

Snippet Snippets.[] (index: number)

Snippet Snippets.anyItem ()

Array of Snippet Snippets.everyItem ()

Snippet Snippets.firstItem ()

Snippet Snippets.item (index: varies)

Snippet Snippets.itemByID (id: number)

Snippet Snippets.itemByName (name: string)

Array of Snippet Snippets.itemByRange (from: varies, to: varies)

Snippet Snippets.lastItem ()

Snippet Snippets.middleItem ()

Snippet Snippets.nextItem (obj: Snippet)

Snippet Snippets.previousItem (obj: Snippet)

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