Snippet

An IDML snippet.

Methods:

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

Objects:

Boolean, Buttons, EPSTexts, EPSs, EventListeners, Events, FormFields, GraphicLines, Graphics, Groups, Images, MultiStateObjects, Number, Object, Ovals, PDFs, PICTs, PageItems, Polygons, Rectangles, SplineItems, String, TextFrames, WMFs

Property Listing

Property

Type

Access

Description

buttons

Buttons Button

readonly

A collection of buttons.

epss

EPSs EPS

readonly

A collection of EPS files.

epstexts

EPSTexts EPSText

readonly

EPSTexts

eventListeners

EventListeners EventListener

readonly

A collection of event listeners.

events

Events Event

readonly

A collection of events.

formFields

FormFields FormField

readonly

A collection of form fields.

graphicLines

GraphicLines GraphicLine

readonly

A collection of graphic lines.

graphics

Graphics Graphic

readonly

A collection of imported graphics in any graphic file format (vector, metafile, or bitmap).

groups

Groups Group

readonly

A collection of groups.

id

Number

readonly

The unique ID of the Snippet.

images

Images Image

readonly

A collection of bitmap images in any bitmap file format (including TIFF, JPEG, or GIF).

index

Number

readonly

The index of the Snippet within its containing object.

isValid

Boolean

readonly

Returns true if the object specifier resolves to valid objects.

label

String

read/write

A property that can be set to any string.

multiStateObjects

MultiStateObjects MultiStateObject

readonly

A collection of multi-state objects.

name

String

read/write

The name of the Snippet; this is an alias to the Snippet's label property.

ovals

Ovals Oval

readonly

A collection of ellipses.

pageItems

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.

parent

PlaceGun

readonly

The parent of the Snippet (a PlaceGun).

pdfs

PDFs PDF

readonly

A collection of PDF files.

picts

PICTs PICT

readonly

A collection of PICT graphics.

polygons

Polygons Polygon

readonly

A collection of polygons.

properties

Object

read/write

A property that allows setting of several properties at the same time.

rectangles

Rectangles Rectangle

readonly

A collection of rectangles.

splineItems

SplineItems SplineItem

readonly

The spline items collection.

textFrames

TextFrames TextFrame

readonly

A collection of text frames.

wmfs

WMFs WMF

readonly

A collection of WMF graphics.

Constants/Events

Name

Type

Access

Description

BEFORE_PLACE

String

readonly

Dispatched before a Snippet is placed. This event bubbles. This event is cancelable.

Method Listing

EventListener addEventListener (eventType:String, handler:Varies File JavaScriptFunction, [captures:Boolean=Boolean])

Adds an event listener.

Parameter

Type

Description

eventType

String

The event type.

handler

File

JavaScriptFunction

The event handler. Can accept: File or JavaScript Function.

captures

Boolean

This parameter is obsolete. (Optional)

(default: false)

String extractLabel (key:String)

Gets the label value associated with the specified key.

Parameter

Type

Description

key

String

The key.

Snippet getElements ()

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

undefined insertLabel (key:String, value:String)

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

Parameter

Type

Description

key

String

The key.

value

String

The value.

undefined remove ()

Deletes the Snippet.

Boolean removeEventListener (eventType:String, handler:Varies File JavaScriptFunction, [captures:Boolean=Boolean])

Removes the event listener.

Parameter

Type

Description

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. (Optional)

(default: false)

String toSource ()

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

String toSpecifier ()

Retrieves the object specifier.

Object of

Button.parent

EPS.parent

EPSText.parent

Event.parent

EventListener.parent

FormField.parent

Graphic.parent

GraphicLine.parent

Group.parent

Image.parent

MultiStateObject.parent

MutationEvent.parent

Oval.parent

PDF.parent

PICT.parent

PageItem.parent

Polygon.parent

Rectangle.parent

SplineItem.parent

TextFrame.parent

WMF.parent

Return

Snippet.getElements()

Snippets.anyItem()

Snippets.everyItem()

Snippets.nextItem()

Snippets.previousItem()

Snippets.itemByID()

Snippets.item()

Snippets.[]()

Snippets.itemByName()

Snippets.itemByRange()

Snippets.firstItem()

Snippets.lastItem()

Snippets.middleItem()