Adobe InDesign CS5 Server (7.0) Object Model JS: Snippet

InDesign Server CS5

Class

Snippet

 An IDML snippet.

QuickLinks

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

Hierarchy

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

Properties

PropertyTypeAccessDescription
buttonsButtons readonlyA collection of buttons.
epssEPSs readonlyA collection of EPS files.
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.
graphicsGraphics readonlyA collection of imported graphics in any graphic file format (vector, metafile, or bitmap).
groupsGroups readonlyA collection of groups.
idnumber readonlyThe unique ID of the Snippet.
imagesImages 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.
multiStateObjectsMultiStateObjects readonlyA collection of multi-state objects.
namestring r/wThe name of the Snippet; this is an alias to the Snippet's label property.
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.
parentPlaceGun readonlyThe parent of the Snippet (a PlaceGun).
pdfsPDFs readonlyA collection of PDF files.
pictsPICTs readonlyA collection of PICT graphics.
polygonsPolygons readonlyA collection of polygons.
propertiesObject r/wA property that allows setting of several properties at the same time.
rectanglesRectangles readonlyA collection of rectangles.
splineItemsSplineItems readonlyThe spline items collection.
textFramesTextFrames readonlyA collection of text frames.
wmfsWMFs 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

EPS.parent

EPSText.parent

FormField.parent

Graphic.parent

GraphicLine.parent

Group.parent

Image.parent

MultiStateObject.parent

Oval.parent

PDF.parent

PICT.parent

PageItem.parent

Polygon.parent

Rectangle.parent

SplineItem.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, 23-Mar-2011 v3.0.3dContents :: Index