Adobe InDesign CS5.5 Server (7.5) Object Model JS: Snippet

InDesign Server CS5.5

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 Button readonlyA collection of buttons.
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.
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.
rectanglesRectangles Rectangle readonlyA collection of rectangles.
splineItemsSplineItems SplineItem readonlyThe spline items collection.
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

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, 28-Apr-2012 v3.0.3iContents :: Index