Adobe InDesign CS2 (4.0) Object Model JS: Swatches

InDesign CS2

Class

Swatches

 A collection of swatches.

QuickLinks

anyItem, count, everyItem, firstItem, item, itemByID, itemByName, itemByRange, lastItem, middleItem, nextItem, previousItem, toSource

Properties

PropertyTypeAccessDescription
lengthnumber readonlyThe number of objects in the collection.

Methods

Instances

Swatch anyItem ()
Returns any Swatch in the collection.

number count ()
Displays the number of elements in the Swatch.

Array of Swatch everyItem ()
Returns every Swatch in the collection.

Swatch firstItem ()
Returns the first Swatch in the collection.

Swatch item (index: any)
Returns the Swatch with the specified index or name.

ParameterTypeDescription
indexLong
String
The index or name. Can accept: Long or String.

Swatch itemByID (id: number)
Returns the Swatch with the specified ID.

ParameterTypeDescription
idnumberThe ID.

Swatch itemByName (name: string)
Returns the Swatch with the specified name.

ParameterTypeDescription
namestringThe name.

Array of Swatch itemByRange (from: any, to: any)
Returns the Swatches within the specified range.

ParameterTypeDescription
fromLong
String
Swatch
The Swatch, index, or name at the beginning of the range. Can accept: Swatch, Long or String.
toLong
String
Swatch
The Swatch, index, or name at the end of the range. Can accept: Swatch, Long or String.

Swatch lastItem ()
Returns the last Swatch in the collection.

Swatch middleItem ()
Returns the middle Swatch in the collection.

Swatch nextItem (obj: Swatch)
Returns the Swatch whose index follows the specified Swatch in the collection.

ParameterTypeDescription
objSwatchThe Swatch whose index comes before the desired Swatch.

Swatch previousItem (obj: Swatch)
Returns the Swatch with the index previous to the specified index.

ParameterTypeDescription
objSwatchThe index of the Swatch that follows the desired Swatch.

string toSource ()
Generates a string which, if executed, will return the Swatch.

Element of

Application.swatches

Document.swatches

Used in:

Swatch Color.merge (with: any)

Swatch Gradient.merge (with: any)

Swatch MixedInk.merge (with: any)

Swatch MixedInkGroup.merge (with: any)

Swatch Swatch.merge (with: any)

Swatch Tint.merge (with: any)

Jongware, 27-Jun-2010 v3.0.3dContents :: Index