Adobe InDesign CS3 (5.0) Object Model JS: Swatch

InDesign CS3

Class

Swatch

 

A swatch (color, gradient, tint, or mixed ink).

Superclass of Color, Gradient, MixedInk, and MixedInkGroup

QuickLinks

duplicate, extractLabel, getElements, insertLabel, merge, remove, toSource, toSpecifier

Hierarchy

Application | Document
Swatch
Color | Gradient | MixedInk | MixedInkGroup

Properties

PropertyTypeAccessDescription
idnumber readonlyThe unique ID of the Swatch.
indexnumber readonlyThe index of the Swatch within its containing object.
labelstring r/wA property that can be set to any string.
namestring r/wThe name of the Swatch.
parentApplicationDocument readonlyThe parent of the Swatch (a Application or Document).
propertiesObject r/wA property that allows setting of several properties at the same time.

Methods

Instances

Swatch duplicate ()
Duplicates the Swatch.

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

ParameterTypeDescription
keystringThe key.

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

Swatch merge (with: any)
Merges the specified swatches with the swatch.

ParameterTypeDescription
with Array of Swatches
String
Swatch
The swatches to merge. Can accept: Array of Swatches, Swatch or String.

void remove ([replacingWith: Swatch])
Deletes the swatch.

ParameterTypeDescription
replacingWithSwatchThe swatch to apply in place of the deleted swatch. (Optional)

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

string toSpecifier ()
Retrieves the object specifier.

Element of

Application.unusedSwatches

BevelAndEmbossSetting.highlightColor

BevelAndEmbossSetting.shadowColor

Button.fillColor

Button.gapColor

Button.strokeColor

Cell.bottomEdgeStrokeColor

Cell.bottomEdgeStrokeGapColor

Cell.diagonalLineStrokeColor

Cell.diagonalLineStrokeGapColor

Cell.fillColor

Cell.innerColumnStrokeColor

Cell.innerColumnStrokeGapColor

Cell.innerRowStrokeColor

Cell.innerRowStrokeGapColor

Cell.leftEdgeStrokeColor

Cell.leftEdgeStrokeGapColor

Cell.rightEdgeStrokeColor

Cell.rightEdgeStrokeGapColor

Cell.topEdgeStrokeColor

Cell.topEdgeStrokeGapColor

CellStyle.bottomEdgeStrokeColor

CellStyle.bottomEdgeStrokeGapColor

CellStyle.diagonalLineStrokeColor

CellStyle.diagonalLineStrokeGapColor

CellStyle.fillColor

CellStyle.leftEdgeStrokeColor

CellStyle.leftEdgeStrokeGapColor

CellStyle.rightEdgeStrokeColor

CellStyle.rightEdgeStrokeGapColor

CellStyle.topEdgeStrokeColor

CellStyle.topEdgeStrokeGapColor

ChangeGrepPreference.fillColor

ChangeGrepPreference.strikeThroughColor

ChangeGrepPreference.strikeThroughGapColor

ChangeGrepPreference.strokeColor

ChangeGrepPreference.underlineColor

ChangeGrepPreference.underlineGapColor

ChangeObjectPreference.fillColor

ChangeObjectPreference.gapColor

ChangeObjectPreference.strokeColor

ChangeTextPreference.fillColor

ChangeTextPreference.strikeThroughColor

ChangeTextPreference.strikeThroughGapColor

ChangeTextPreference.strokeColor

ChangeTextPreference.underlineColor

ChangeTextPreference.underlineGapColor

Character.fillColor

Character.ruleAboveColor

Character.ruleAboveGapColor

Character.ruleBelowColor

Character.ruleBelowGapColor

Character.strikeThroughColor

Character.strikeThroughGapColor

Character.strokeColor

Character.underlineColor

Character.underlineGapColor

CharacterStyle.fillColor

CharacterStyle.strikeThroughColor

CharacterStyle.strikeThroughGapColor

CharacterStyle.strokeColor

CharacterStyle.underlineColor

CharacterStyle.underlineGapColor

Column.bottomEdgeStrokeColor

Column.bottomEdgeStrokeGapColor

Column.diagonalLineStrokeColor

Column.diagonalLineStrokeGapColor

Column.fillColor

Column.innerColumnStrokeColor

Column.innerColumnStrokeGapColor

Column.innerRowStrokeColor

Column.innerRowStrokeGapColor

Column.leftEdgeStrokeColor

Column.leftEdgeStrokeGapColor

Column.rightEdgeStrokeColor

Column.rightEdgeStrokeGapColor

Column.topEdgeStrokeColor

Column.topEdgeStrokeGapColor

Document.unusedSwatches

DropShadowSetting.effectColor

FindGrepPreference.fillColor

FindGrepPreference.strikeThroughColor

FindGrepPreference.strikeThroughGapColor

FindGrepPreference.strokeColor

FindGrepPreference.underlineColor

FindGrepPreference.underlineGapColor

FindObjectPreference.fillColor

FindObjectPreference.gapColor

FindObjectPreference.strokeColor

FindTextPreference.fillColor

FindTextPreference.strikeThroughColor

FindTextPreference.strikeThroughGapColor

FindTextPreference.strokeColor

FindTextPreference.underlineColor

FindTextPreference.underlineGapColor

FootnoteOption.continuingRuleColor

FootnoteOption.continuingRuleGapColor

FootnoteOption.ruleColor

FootnoteOption.ruleGapColor

FormField.fillColor

FormField.gapColor

FormField.strokeColor

GraphicLine.fillColor

GraphicLine.gapColor

GraphicLine.strokeColor

Group.fillColor

Group.gapColor

Group.strokeColor

Image.fillColor

InnerGlowSetting.effectColor

InnerShadowSetting.effectColor

InsertionPoint.fillColor

InsertionPoint.ruleAboveColor

InsertionPoint.ruleAboveGapColor

InsertionPoint.ruleBelowColor

InsertionPoint.ruleBelowGapColor

InsertionPoint.strikeThroughColor

InsertionPoint.strikeThroughGapColor

InsertionPoint.strokeColor

InsertionPoint.underlineColor

InsertionPoint.underlineGapColor

Line.fillColor

Line.ruleAboveColor

Line.ruleAboveGapColor

Line.ruleBelowColor

Line.ruleBelowGapColor

Line.strikeThroughColor

Line.strikeThroughGapColor

Line.strokeColor

Line.underlineColor

Line.underlineGapColor

ObjectStyle.fillColor

ObjectStyle.gapColor

ObjectStyle.strokeColor

OuterGlowSetting.effectColor

Oval.fillColor

Oval.gapColor

Oval.strokeColor

PageItem.fillColor

PageItem.gapColor

PageItem.strokeColor

PageItemDefault.fillColor

PageItemDefault.gapColor

PageItemDefault.strokeColor

Paragraph.fillColor

Paragraph.ruleAboveColor

Paragraph.ruleAboveGapColor

Paragraph.ruleBelowColor

Paragraph.ruleBelowGapColor

Paragraph.strikeThroughColor

Paragraph.strikeThroughGapColor

Paragraph.strokeColor

Paragraph.underlineColor

Paragraph.underlineGapColor

ParagraphStyle.fillColor

ParagraphStyle.ruleAboveColor

ParagraphStyle.ruleAboveGapColor

ParagraphStyle.ruleBelowColor

ParagraphStyle.ruleBelowGapColor

ParagraphStyle.strikeThroughColor

ParagraphStyle.strikeThroughGapColor

ParagraphStyle.strokeColor

ParagraphStyle.underlineColor

ParagraphStyle.underlineGapColor

Polygon.fillColor

Polygon.gapColor

Polygon.strokeColor

Rectangle.fillColor

Rectangle.gapColor

Rectangle.strokeColor

Row.bottomEdgeStrokeColor

Row.bottomEdgeStrokeGapColor

Row.diagonalLineStrokeColor

Row.diagonalLineStrokeGapColor

Row.fillColor

Row.innerColumnStrokeColor

Row.innerColumnStrokeGapColor

Row.innerRowStrokeColor

Row.innerRowStrokeGapColor

Row.leftEdgeStrokeColor

Row.leftEdgeStrokeGapColor

Row.rightEdgeStrokeColor

Row.rightEdgeStrokeGapColor

Row.topEdgeStrokeColor

Row.topEdgeStrokeGapColor

SatinSetting.effectColor

Story.fillColor

Story.ruleAboveColor

Story.ruleAboveGapColor

Story.ruleBelowColor

Story.ruleBelowGapColor

Story.strikeThroughColor

Story.strikeThroughGapColor

Story.strokeColor

Story.underlineColor

Story.underlineGapColor

Table.bottomBorderStrokeColor

Table.bottomBorderStrokeGapColor

Table.endColumnFillColor

Table.endColumnStrokeColor

Table.endColumnStrokeGapColor

Table.endRowFillColor

Table.endRowStrokeColor

Table.endRowStrokeGapColor

Table.leftBorderStrokeColor

Table.leftBorderStrokeGapColor

Table.rightBorderStrokeColor

Table.rightBorderStrokeGapColor

Table.startColumnFillColor

Table.startColumnStrokeColor

Table.startColumnStrokeGapColor

Table.startRowFillColor

Table.startRowStrokeColor

Table.startRowStrokeGapColor

Table.topBorderStrokeColor

Table.topBorderStrokeGapColor

TableStyle.bottomBorderStrokeColor

TableStyle.bottomBorderStrokeGapColor

TableStyle.endColumnFillColor

TableStyle.endColumnStrokeColor

TableStyle.endColumnStrokeGapColor

TableStyle.endRowFillColor

TableStyle.endRowStrokeColor

TableStyle.endRowStrokeGapColor

TableStyle.leftBorderStrokeColor

TableStyle.leftBorderStrokeGapColor

TableStyle.rightBorderStrokeColor

TableStyle.rightBorderStrokeGapColor

TableStyle.startColumnFillColor

TableStyle.startColumnStrokeColor

TableStyle.startColumnStrokeGapColor

TableStyle.startRowFillColor

TableStyle.startRowStrokeColor

TableStyle.startRowStrokeGapColor

TableStyle.topBorderStrokeColor

TableStyle.topBorderStrokeGapColor

Text.fillColor

Text.ruleAboveColor

Text.ruleAboveGapColor

Text.ruleBelowColor

Text.ruleBelowGapColor

Text.strikeThroughColor

Text.strikeThroughGapColor

Text.strokeColor

Text.underlineColor

Text.underlineGapColor

TextColumn.fillColor

TextColumn.ruleAboveColor

TextColumn.ruleAboveGapColor

TextColumn.ruleBelowColor

TextColumn.ruleBelowGapColor

TextColumn.strikeThroughColor

TextColumn.strikeThroughGapColor

TextColumn.strokeColor

TextColumn.underlineColor

TextColumn.underlineGapColor

TextDefault.fillColor

TextDefault.ruleAboveColor

TextDefault.ruleAboveGapColor

TextDefault.ruleBelowColor

TextDefault.ruleBelowGapColor

TextDefault.strikeThroughColor

TextDefault.strikeThroughGapColor

TextDefault.strokeColor

TextDefault.underlineColor

TextDefault.underlineGapColor

TextFrame.fillColor

TextFrame.gapColor

TextFrame.strokeColor

TextStyleRange.fillColor

TextStyleRange.ruleAboveColor

TextStyleRange.ruleAboveGapColor

TextStyleRange.ruleBelowColor

TextStyleRange.ruleBelowGapColor

TextStyleRange.strikeThroughColor

TextStyleRange.strikeThroughGapColor

TextStyleRange.strokeColor

TextStyleRange.underlineColor

TextStyleRange.underlineGapColor

Word.fillColor

Word.ruleAboveColor

Word.ruleAboveGapColor

Word.ruleBelowColor

Word.ruleBelowGapColor

Word.strikeThroughColor

Word.strikeThroughGapColor

Word.strokeColor

Word.underlineColor

Word.underlineGapColor

XmlStory.fillColor

XmlStory.ruleAboveColor

XmlStory.ruleAboveGapColor

XmlStory.ruleBelowColor

XmlStory.ruleBelowGapColor

XmlStory.strikeThroughColor

XmlStory.strikeThroughGapColor

XmlStory.strokeColor

XmlStory.underlineColor

XmlStory.underlineGapColor

Used in:

void Application.saveSwatches (to: File, swatchList: Array of Swatch[, versionComments: string][, forceSave: bool=false])

Swatch Color.merge (with: any)

void Color.remove ([replacingWith: Swatch])

void Document.saveSwatches (to: File, swatchList: Array of Swatch[, versionComments: string][, forceSave: bool=false])

Swatch Gradient.merge (with: any)

void Gradient.remove ([replacingWith: Swatch])

Swatch MixedInk.merge (with: any)

void MixedInk.remove ([replacingWith: Swatch])

Swatch MixedInkGroup.merge (with: any)

void MixedInkGroup.remove ([replacingWith: Swatch])

Swatch Swatch.merge (with: any)

void Swatch.remove ([replacingWith: Swatch])

array of Swatch Swatches.itemByRange (from: any, to: any)

Swatch Swatches.nextItem (obj: Swatch)

Swatch Swatches.previousItem (obj: Swatch)

Swatch Tint.merge (with: any)

void Tint.remove ([replacingWith: Swatch])

Return

Swatch Color.merge (with: any)

Swatch Gradient.merge (with: any)

Swatch MixedInk.merge (with: any)

Swatch MixedInkGroup.merge (with: any)

Swatch Swatch.duplicate ()

Array of Swatch Swatch.getElements ()

Swatch Swatch.merge (with: any)

Swatch Swatches.anyItem ()

Array of Swatch Swatches.everyItem ()

Swatch Swatches.firstItem ()

Swatch Swatches.item (index: any)

Swatch Swatches.itemByID (id: number)

Swatch Swatches.itemByName (name: string)

Array of Swatch Swatches.itemByRange (from: any, to: any)

Swatch Swatches.lastItem ()

Swatch Swatches.middleItem ()

Swatch Swatches.nextItem (obj: Swatch)

Swatch Swatches.previousItem (obj: Swatch)

Swatch Tint.merge (with: any)

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