Swatch

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

Properties

Property Type Access Description
id number readonly The unique ID of the Swatch.
index number readonly The index of the Swatch within its containing object.
label string r/w A property that can be set to any string.
name string r/w The name of the Swatch.
parent any readonly The parent of the Swatch (a Application or Document).
properties Object r/w A property that allows setting of several properties at the same time.

Methods

Swatchduplicate ()
Duplicates the Swatch.

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

Parameter Type Description
key string The key.

Array of SwatchgetElements ()
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.

Parameter Type Description
key string The key.
value string The value.

Swatchmerge (with:
any)
Merges the specified swatches with the swatch.

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

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

Parameter Type Description
replacingWith Swatch The 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
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
Character.fillColor
Character.strokeColor
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
FormField.fillColor
FormField.gapColor
FormField.strokeColor
GraphicLine.fillColor
GraphicLine.gapColor
GraphicLine.strokeColor
Group.fillColor
Group.gapColor
Group.strokeColor
Image.fillColor
InsertionPoint.fillColor
InsertionPoint.strokeColor
Line.fillColor
Line.strokeColor
ObjectStyle.fillColor
ObjectStyle.gapColor
ObjectStyle.strokeColor
Oval.fillColor
Oval.gapColor
Oval.strokeColor
PageItem.fillColor
PageItem.gapColor
PageItem.strokeColor
PageItemDefault.fillColor
PageItemDefault.gapColor
PageItemDefault.strokeColor
Paragraph.fillColor
Paragraph.strokeColor
ParagraphStyle.fillColor
ParagraphStyle.strokeColor
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
Story.fillColor
Story.strokeColor
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.strokeColor
TextColumn.fillColor
TextColumn.strokeColor
TextDefault.fillColor
TextDefault.strokeColor
TextFrame.fillColor
TextFrame.gapColor
TextFrame.strokeColor
TextStyleRange.fillColor
TextStyleRange.strokeColor
Word.fillColor
Word.strokeColor
XmlStory.fillColor
XmlStory.strokeColor

Used in:

Application.saveSwatches (

to:
File, swatchList:
Array of Swatch [, versionComments:
string][, forceSave:
bool=false ])

Color.remove (

[replacingWith:
Swatch ])

Document.saveSwatches (

to:
File, swatchList:
Array of Swatch [, versionComments:
string][, forceSave:
bool=false ])

Gradient.remove (

[replacingWith:
Swatch ])

MixedInk.remove (

[replacingWith:
Swatch ])

MixedInkGroup.remove (

[replacingWith:
Swatch ])

Swatch.remove (

[replacingWith:
Swatch ])

Swatches.previousItem (

obj:
Swatch )

Swatches.nextItem (

obj:
Swatch )

Tint.remove (

[replacingWith:
Swatch ])

Returned by:

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
)

Leave a Comment

Previous post:

Next post: