Adobe InDesign CS (3.0) Object Model JS: Swatch

InDesign CS

Class

Swatch

 

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

Superclass of Color, Gradient, MixedInk, and MixedInkGroup

QuickLinks

duplicate, extractLabel, insertLabel, merge, remove

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.

void insertLabel (key: string, value: string)
Sets the label to the value associated with the specified key.

ParameterTypeDescription
keystringThe key.
valuestringThe value.

void merge (with: any)
Merge one or more other swatches into this one.

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

void remove (replacingWith: Swatch)
Delete swatch.

ParameterTypeDescription
replacingWithSwatchThe swatch to apply in place of this one

Element of

Application.unusedSwatches

Button.fillColor

Button.gapColor

Button.shadowColor

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

ChangePreference.bulletsAndNumberingColor

ChangePreference.fillColor

ChangePreference.strikeThroughColor

ChangePreference.strikeThroughGapColor

ChangePreference.strokeColor

ChangePreference.underlineColor

ChangePreference.underlineGapColor

Character.bulletsAndNumberingColor

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

EPS.shadowColor

FindPreference.bulletsAndNumberingColor

FindPreference.fillColor

FindPreference.strikeThroughColor

FindPreference.strikeThroughGapColor

FindPreference.strokeColor

FindPreference.underlineColor

FindPreference.underlineGapColor

FormField.fillColor

FormField.gapColor

FormField.shadowColor

FormField.strokeColor

GraphicLine.fillColor

GraphicLine.gapColor

GraphicLine.shadowColor

GraphicLine.strokeColor

Group.fillColor

Group.gapColor

Group.shadowColor

Group.strokeColor

Image.fillColor

Image.shadowColor

InsertionPoint.bulletsAndNumberingColor

InsertionPoint.fillColor

InsertionPoint.ruleAboveColor

InsertionPoint.ruleAboveGapColor

InsertionPoint.ruleBelowColor

InsertionPoint.ruleBelowGapColor

InsertionPoint.strikeThroughColor

InsertionPoint.strikeThroughGapColor

InsertionPoint.strokeColor

InsertionPoint.underlineColor

InsertionPoint.underlineGapColor

Line.bulletsAndNumberingColor

Line.fillColor

Line.ruleAboveColor

Line.ruleAboveGapColor

Line.ruleBelowColor

Line.ruleBelowGapColor

Line.strikeThroughColor

Line.strikeThroughGapColor

Line.strokeColor

Line.underlineColor

Line.underlineGapColor

Oval.fillColor

Oval.gapColor

Oval.shadowColor

Oval.strokeColor

PDF.shadowColor

PICT.shadowColor

PageItem.fillColor

PageItem.gapColor

PageItem.shadowColor

PageItem.strokeColor

Paragraph.bulletsAndNumberingColor

Paragraph.fillColor

Paragraph.ruleAboveColor

Paragraph.ruleAboveGapColor

Paragraph.ruleBelowColor

Paragraph.ruleBelowGapColor

Paragraph.strikeThroughColor

Paragraph.strikeThroughGapColor

Paragraph.strokeColor

Paragraph.underlineColor

Paragraph.underlineGapColor

ParagraphStyle.bulletsAndNumberingColor

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.shadowColor

Polygon.strokeColor

Rectangle.fillColor

Rectangle.gapColor

Rectangle.shadowColor

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

Story.bulletsAndNumberingColor

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

Text.bulletsAndNumberingColor

Text.fillColor

Text.ruleAboveColor

Text.ruleAboveGapColor

Text.ruleBelowColor

Text.ruleBelowGapColor

Text.strikeThroughColor

Text.strikeThroughGapColor

Text.strokeColor

Text.underlineColor

Text.underlineGapColor

TextColumn.bulletsAndNumberingColor

TextColumn.fillColor

TextColumn.ruleAboveColor

TextColumn.ruleAboveGapColor

TextColumn.ruleBelowColor

TextColumn.ruleBelowGapColor

TextColumn.strikeThroughColor

TextColumn.strikeThroughGapColor

TextColumn.strokeColor

TextColumn.underlineColor

TextColumn.underlineGapColor

TextDefault.bulletsAndNumberingColor

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.shadowColor

TextFrame.strokeColor

TextStyleRange.bulletsAndNumberingColor

TextStyleRange.fillColor

TextStyleRange.ruleAboveColor

TextStyleRange.ruleAboveGapColor

TextStyleRange.ruleBelowColor

TextStyleRange.ruleBelowGapColor

TextStyleRange.strikeThroughColor

TextStyleRange.strikeThroughGapColor

TextStyleRange.strokeColor

TextStyleRange.underlineColor

TextStyleRange.underlineGapColor

WMF.shadowColor

Word.bulletsAndNumberingColor

Word.fillColor

Word.ruleAboveColor

Word.ruleAboveGapColor

Word.ruleBelowColor

Word.ruleBelowGapColor

Word.strikeThroughColor

Word.strikeThroughGapColor

Word.strokeColor

Word.underlineColor

Word.underlineGapColor

Used in:

void Character.applyBullets ([bulletChar: number][, bulletType: Bulletcharactertype][, bulletFont: any][, bulletFontStyle: string][, bulletSize: number][, bulletColor: Swatch][, bulletAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void Character.applyNumbers ([numberingStyle: NumberingStyle][, numberingSeparator: number][, startingValue: number][, numberFont: any][, numberFontStyle: string][, numberSize: number][, numberColor: Swatch][, numberAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void Color.merge (with: any)

void Color.remove (replacingWith: Swatch)

void Gradient.merge (with: any)

void Gradient.remove (replacingWith: Swatch)

void InsertionPoint.applyBullets ([bulletChar: number][, bulletType: Bulletcharactertype][, bulletFont: any][, bulletFontStyle: string][, bulletSize: number][, bulletColor: Swatch][, bulletAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void InsertionPoint.applyNumbers ([numberingStyle: NumberingStyle][, numberingSeparator: number][, startingValue: number][, numberFont: any][, numberFontStyle: string][, numberSize: number][, numberColor: Swatch][, numberAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void Line.applyBullets ([bulletChar: number][, bulletType: Bulletcharactertype][, bulletFont: any][, bulletFontStyle: string][, bulletSize: number][, bulletColor: Swatch][, bulletAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void Line.applyNumbers ([numberingStyle: NumberingStyle][, numberingSeparator: number][, startingValue: number][, numberFont: any][, numberFontStyle: string][, numberSize: number][, numberColor: Swatch][, numberAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void MixedInk.merge (with: any)

void MixedInk.remove (replacingWith: Swatch)

void MixedInkGroup.merge (with: any)

void MixedInkGroup.remove (replacingWith: Swatch)

void Paragraph.applyBullets ([bulletChar: number][, bulletType: Bulletcharactertype][, bulletFont: any][, bulletFontStyle: string][, bulletSize: number][, bulletColor: Swatch][, bulletAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void Paragraph.applyNumbers ([numberingStyle: NumberingStyle][, numberingSeparator: number][, startingValue: number][, numberFont: any][, numberFontStyle: string][, numberSize: number][, numberColor: Swatch][, numberAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void Story.applyBullets ([bulletChar: number][, bulletType: Bulletcharactertype][, bulletFont: any][, bulletFontStyle: string][, bulletSize: number][, bulletColor: Swatch][, bulletAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void Story.applyNumbers ([numberingStyle: NumberingStyle][, numberingSeparator: number][, startingValue: number][, numberFont: any][, numberFontStyle: string][, numberSize: number][, numberColor: Swatch][, numberAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void Swatch.merge (with: any)

void Swatch.remove (replacingWith: Swatch)

void Text.applyBullets ([bulletChar: number][, bulletType: Bulletcharactertype][, bulletFont: any][, bulletFontStyle: string][, bulletSize: number][, bulletColor: Swatch][, bulletAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void Text.applyNumbers ([numberingStyle: NumberingStyle][, numberingSeparator: number][, startingValue: number][, numberFont: any][, numberFontStyle: string][, numberSize: number][, numberColor: Swatch][, numberAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void TextColumn.applyBullets ([bulletChar: number][, bulletType: Bulletcharactertype][, bulletFont: any][, bulletFontStyle: string][, bulletSize: number][, bulletColor: Swatch][, bulletAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void TextColumn.applyNumbers ([numberingStyle: NumberingStyle][, numberingSeparator: number][, startingValue: number][, numberFont: any][, numberFontStyle: string][, numberSize: number][, numberColor: Swatch][, numberAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void TextStyleRange.applyBullets ([bulletChar: number][, bulletType: Bulletcharactertype][, bulletFont: any][, bulletFontStyle: string][, bulletSize: number][, bulletColor: Swatch][, bulletAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void TextStyleRange.applyNumbers ([numberingStyle: NumberingStyle][, numberingSeparator: number][, startingValue: number][, numberFont: any][, numberFontStyle: string][, numberSize: number][, numberColor: Swatch][, numberAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void Tint.merge (with: any)

void Tint.remove (replacingWith: Swatch)

void Word.applyBullets ([bulletChar: number][, bulletType: Bulletcharactertype][, bulletFont: any][, bulletFontStyle: string][, bulletSize: number][, bulletColor: Swatch][, bulletAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

void Word.applyNumbers ([numberingStyle: NumberingStyle][, numberingSeparator: number][, startingValue: number][, numberFont: any][, numberFontStyle: string][, numberSize: number][, numberColor: Swatch][, numberAlignment: ListAlignment=ListAlignment.HANGING_LIST][, listLeftIndent: number][, listFirstLineIndent: number][, listFirstTabPosition: number])

Return

Swatch Swatch.duplicate ()

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