Swatch

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

Methods:

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

Objects:

Boolean, ColorGroup, EventListeners, Events, Number, Object, String

Hierarchy:

Class: Swatch

Subclasses: MixedInk | MixedInkGroup | Gradient | Color

Property Listing

Property

Type

Access

Description

eventListeners

EventListeners EventListener

readonly

A collection of event listeners.

events

Events Event

readonly

A collection of events.

id

Number

readonly

The unique ID of the Swatch.

index

Number

readonly

The index of the Swatch 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.

name

String

read/write

The name of the Swatch.

parent

Application

Document

readonly

The parent of the Swatch (a Application or Document).

parentColorGroup

ColorGroup

readonly

The color group that a swatch belongs to

properties

Object

read/write

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

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)

Swatch duplicate ()

Duplicates the Swatch.

String extractLabel (key:String)

Gets the label value associated with the specified key.

Parameter

Type

Description

key

String

The key.

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

Swatch merge (with:Array of Varies Swatches Swatch String)

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.

undefined remove (replacingWith:Swatch)

Deletes the swatch.

Parameter

Type

Description

replacingWith

Swatch

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

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

String toSpecifier ()

Retrieves the object specifier.

Object of

DropShadowSetting.effectColor

FindChangeDropShadowSetting.effectColor

BevelAndEmbossSetting.highlightColor

FindChangeBevelAndEmbossSetting.highlightColor

InnerGlowSetting.effectColor

FindChangeInnerGlowSetting.effectColor

InnerShadowSetting.effectColor

FindChangeInnerShadowSetting.effectColor

OuterGlowSetting.effectColor

FindChangeOuterGlowSetting.effectColor

SatinSetting.effectColor

FindChangeSatinSetting.effectColor

BevelAndEmbossSetting.shadowColor

FindChangeBevelAndEmbossSetting.shadowColor

Table.startRowStrokeColor

TableStyle.startRowStrokeColor

Table.bottomBorderStrokeColor

TableStyle.bottomBorderStrokeColor

Table.leftBorderStrokeColor

TableStyle.leftBorderStrokeColor

Table.rightBorderStrokeColor

TableStyle.rightBorderStrokeColor

Table.topBorderStrokeColor

TableStyle.topBorderStrokeColor

Cell.innerColumnStrokeColor

Column.innerColumnStrokeColor

Row.innerColumnStrokeColor

Cell.innerRowStrokeColor

Column.innerRowStrokeColor

Row.innerRowStrokeColor

Cell.rightEdgeStrokeColor

Column.rightEdgeStrokeColor

Row.rightEdgeStrokeColor

CellStyle.rightEdgeStrokeColor

Cell.diagonalLineStrokeColor

Column.diagonalLineStrokeColor

Row.diagonalLineStrokeColor

CellStyle.diagonalLineStrokeColor

Table.startColumnFillColor

TableStyle.startColumnFillColor

Table.endColumnFillColor

TableStyle.endColumnFillColor

Table.startRowFillColor

TableStyle.startRowFillColor

Table.endRowFillColor

TableStyle.endRowFillColor

Table.endRowStrokeGapColor

TableStyle.endRowStrokeGapColor

Table.bottomBorderStrokeGapColor

TableStyle.bottomBorderStrokeGapColor

Table.leftBorderStrokeGapColor

TableStyle.leftBorderStrokeGapColor

Table.rightBorderStrokeGapColor

TableStyle.rightBorderStrokeGapColor

Table.topBorderStrokeGapColor

TableStyle.topBorderStrokeGapColor

Event.parent

EventListener.parent

MutationEvent.parent

Table.startColumnStrokeColor

TableStyle.startColumnStrokeColor

Table.endColumnStrokeColor

TableStyle.endColumnStrokeColor

Table.endRowStrokeColor

TableStyle.endRowStrokeColor

Table.startRowStrokeGapColor

TableStyle.startRowStrokeGapColor

Table.startColumnStrokeGapColor

TableStyle.startColumnStrokeGapColor

Table.endColumnStrokeGapColor

TableStyle.endColumnStrokeGapColor

Cell.bottomEdgeStrokeColor

Column.bottomEdgeStrokeColor

Row.bottomEdgeStrokeColor

CellStyle.bottomEdgeStrokeColor

TextDefault.kentenFillColor

Text.kentenFillColor

Character.kentenFillColor

Word.kentenFillColor

Line.kentenFillColor

TextColumn.kentenFillColor

Paragraph.kentenFillColor

TextStyleRange.kentenFillColor

InsertionPoint.kentenFillColor

Story.kentenFillColor

ParagraphStyle.kentenFillColor

XmlStory.kentenFillColor

FindTextPreference.kentenFillColor

FindGrepPreference.kentenFillColor

FindTransliteratePreference.kentenFillColor

ChangeTextPreference.kentenFillColor

ChangeGrepPreference.kentenFillColor

ChangeTransliteratePreference.kentenFillColor

CharacterStyle.kentenFillColor

TextDefault.rubyFill

Text.rubyFill

Character.rubyFill

Word.rubyFill

Line.rubyFill

TextColumn.rubyFill

Paragraph.rubyFill

TextStyleRange.rubyFill

InsertionPoint.rubyFill

Story.rubyFill

ParagraphStyle.rubyFill

XmlStory.rubyFill

FindTextPreference.rubyFill

FindGrepPreference.rubyFill

FindTransliteratePreference.rubyFill

ChangeTextPreference.rubyFill

ChangeGrepPreference.rubyFill

ChangeTransliteratePreference.rubyFill

CharacterStyle.rubyFill

Button.fillColor

ChangeObjectPreference.fillColor

Character.fillColor

CharacterStyle.fillColor

CheckBox.fillColor

ComboBox.fillColor

EPS.fillColor

EPSText.fillColor

EndnoteTextFrame.fillColor

FindObjectPreference.fillColor

FormField.fillColor

Graphic.fillColor

GraphicLine.fillColor

Group.fillColor

HtmlItem.fillColor

Image.fillColor

ImportedPage.fillColor

InsertionPoint.fillColor

Line.fillColor

ListBox.fillColor

MediaItem.fillColor

Movie.fillColor

MultiStateObject.fillColor

ObjectStyle.fillColor

Oval.fillColor

PDF.fillColor

PICT.fillColor

PageItem.fillColor

PageItemDefault.fillColor

Paragraph.fillColor

ParagraphStyle.fillColor

Polygon.fillColor

RadioButton.fillColor

Rectangle.fillColor

SignatureField.fillColor

Sound.fillColor

SplineItem.fillColor

Story.fillColor

StrokeFillProxySetting.fillColor

Text.fillColor

TextBox.fillColor

TextColumn.fillColor

TextDefault.fillColor

TextFrame.fillColor

TextStyleRange.fillColor

WMF.fillColor

Word.fillColor

XmlStory.fillColor

Cell.fillColor

Column.fillColor

Row.fillColor

CellStyle.fillColor

FormField.gapColor

Button.gapColor

MultiStateObject.gapColor

CheckBox.gapColor

ComboBox.gapColor

ListBox.gapColor

RadioButton.gapColor

TextBox.gapColor

SignatureField.gapColor

Movie.gapColor

Sound.gapColor

PageItem.gapColor

Oval.gapColor

Rectangle.gapColor

GraphicLine.gapColor

Polygon.gapColor

Group.gapColor

Image.gapColor

EPS.gapColor

PDF.gapColor

WMF.gapColor

PICT.gapColor

Graphic.gapColor

SplineItem.gapColor

EPSText.gapColor

ImportedPage.gapColor

MediaItem.gapColor

HtmlItem.gapColor

ObjectStyle.gapColor

PageItemDefault.gapColor

TextFrame.gapColor

EndnoteTextFrame.gapColor

FindObjectPreference.gapColor

ChangeObjectPreference.gapColor

Cell.bottomEdgeStrokeGapColor

Column.bottomEdgeStrokeGapColor

Row.bottomEdgeStrokeGapColor

CellStyle.bottomEdgeStrokeGapColor

Cell.diagonalLineStrokeGapColor

Column.diagonalLineStrokeGapColor

Row.diagonalLineStrokeGapColor

CellStyle.diagonalLineStrokeGapColor

Cell.innerColumnStrokeGapColor

Column.innerColumnStrokeGapColor

Row.innerColumnStrokeGapColor

Cell.innerRowStrokeGapColor

Column.innerRowStrokeGapColor

Row.innerRowStrokeGapColor

Cell.leftEdgeStrokeGapColor

Column.leftEdgeStrokeGapColor

Row.leftEdgeStrokeGapColor

CellStyle.leftEdgeStrokeGapColor

Cell.rightEdgeStrokeGapColor

Column.rightEdgeStrokeGapColor

Row.rightEdgeStrokeGapColor

CellStyle.rightEdgeStrokeGapColor

TextDefault.strikeThroughGapColor

Text.strikeThroughGapColor

Character.strikeThroughGapColor

Word.strikeThroughGapColor

Line.strikeThroughGapColor

TextColumn.strikeThroughGapColor

Paragraph.strikeThroughGapColor

TextStyleRange.strikeThroughGapColor

InsertionPoint.strikeThroughGapColor

Story.strikeThroughGapColor

ParagraphStyle.strikeThroughGapColor

XmlStory.strikeThroughGapColor

FindTextPreference.strikeThroughGapColor

FindGrepPreference.strikeThroughGapColor

FindTransliteratePreference.strikeThroughGapColor

ChangeTextPreference.strikeThroughGapColor

ChangeGrepPreference.strikeThroughGapColor

ChangeTransliteratePreference.strikeThroughGapColor

CharacterStyle.strikeThroughGapColor

Cell.topEdgeStrokeGapColor

Column.topEdgeStrokeGapColor

Row.topEdgeStrokeGapColor

CellStyle.topEdgeStrokeGapColor

TextDefault.underlineGapColor

Text.underlineGapColor

Character.underlineGapColor

Word.underlineGapColor

Line.underlineGapColor

TextColumn.underlineGapColor

Paragraph.underlineGapColor

TextStyleRange.underlineGapColor

InsertionPoint.underlineGapColor

Story.underlineGapColor

ParagraphStyle.underlineGapColor

XmlStory.underlineGapColor

FindTextPreference.underlineGapColor

FindGrepPreference.underlineGapColor

FindTransliteratePreference.underlineGapColor

ChangeTextPreference.underlineGapColor

ChangeGrepPreference.underlineGapColor

ChangeTransliteratePreference.underlineGapColor

CharacterStyle.underlineGapColor

Cell.leftEdgeStrokeColor

Column.leftEdgeStrokeColor

Row.leftEdgeStrokeColor

CellStyle.leftEdgeStrokeColor

TextDefault.paragraphBorderGapColor

Text.paragraphBorderGapColor

Character.paragraphBorderGapColor

Word.paragraphBorderGapColor

Line.paragraphBorderGapColor

TextColumn.paragraphBorderGapColor

Paragraph.paragraphBorderGapColor

TextStyleRange.paragraphBorderGapColor

InsertionPoint.paragraphBorderGapColor

Story.paragraphBorderGapColor

ParagraphStyle.paragraphBorderGapColor

XmlStory.paragraphBorderGapColor

TextDefault.ruleAboveColor

Text.ruleAboveColor

Character.ruleAboveColor

Word.ruleAboveColor

Line.ruleAboveColor

TextColumn.ruleAboveColor

Paragraph.ruleAboveColor

TextStyleRange.ruleAboveColor

InsertionPoint.ruleAboveColor

Story.ruleAboveColor

ParagraphStyle.ruleAboveColor

XmlStory.ruleAboveColor

TextDefault.ruleBelowColor

Text.ruleBelowColor

Character.ruleBelowColor

Word.ruleBelowColor

Line.ruleBelowColor

TextColumn.ruleBelowColor

Paragraph.ruleBelowColor

TextStyleRange.ruleBelowColor

InsertionPoint.ruleBelowColor

Story.ruleBelowColor

ParagraphStyle.ruleBelowColor

XmlStory.ruleBelowColor

TextDefault.paragraphShadingColor

Text.paragraphShadingColor

Character.paragraphShadingColor

Word.paragraphShadingColor

Line.paragraphShadingColor

TextColumn.paragraphShadingColor

Paragraph.paragraphShadingColor

TextStyleRange.paragraphShadingColor

InsertionPoint.paragraphShadingColor

Story.paragraphShadingColor

ParagraphStyle.paragraphShadingColor

XmlStory.paragraphShadingColor

TextDefault.paragraphBorderColor

Text.paragraphBorderColor

Character.paragraphBorderColor

Word.paragraphBorderColor

Line.paragraphBorderColor

TextColumn.paragraphBorderColor

Paragraph.paragraphBorderColor

TextStyleRange.paragraphBorderColor

InsertionPoint.paragraphBorderColor

Story.paragraphBorderColor

ParagraphStyle.paragraphBorderColor

XmlStory.paragraphBorderColor

FootnoteOption.continuingRuleColor

TextDefault.strikeThroughColor

Text.strikeThroughColor

Character.strikeThroughColor

Word.strikeThroughColor

Line.strikeThroughColor

TextColumn.strikeThroughColor

Paragraph.strikeThroughColor

TextStyleRange.strikeThroughColor

InsertionPoint.strikeThroughColor

Story.strikeThroughColor

ParagraphStyle.strikeThroughColor

XmlStory.strikeThroughColor

FindTextPreference.strikeThroughColor

FindGrepPreference.strikeThroughColor

FindTransliteratePreference.strikeThroughColor

ChangeTextPreference.strikeThroughColor

ChangeGrepPreference.strikeThroughColor

ChangeTransliteratePreference.strikeThroughColor

CharacterStyle.strikeThroughColor

TextDefault.ruleAboveGapColor

Text.ruleAboveGapColor

Character.ruleAboveGapColor

Word.ruleAboveGapColor

Line.ruleAboveGapColor

TextColumn.ruleAboveGapColor

Paragraph.ruleAboveGapColor

TextStyleRange.ruleAboveGapColor

InsertionPoint.ruleAboveGapColor

Story.ruleAboveGapColor

ParagraphStyle.ruleAboveGapColor

XmlStory.ruleAboveGapColor

TextDefault.ruleBelowGapColor

Text.ruleBelowGapColor

Character.ruleBelowGapColor

Word.ruleBelowGapColor

Line.ruleBelowGapColor

TextColumn.ruleBelowGapColor

Paragraph.ruleBelowGapColor

TextStyleRange.ruleBelowGapColor

InsertionPoint.ruleBelowGapColor

Story.ruleBelowGapColor

ParagraphStyle.ruleBelowGapColor

XmlStory.ruleBelowGapColor

FootnoteOption.continuingRuleGapColor

FootnoteOption.ruleGapColor

TextDefault.kentenStrokeColor

Text.kentenStrokeColor

Character.kentenStrokeColor

Word.kentenStrokeColor

Line.kentenStrokeColor

TextColumn.kentenStrokeColor

Paragraph.kentenStrokeColor

TextStyleRange.kentenStrokeColor

InsertionPoint.kentenStrokeColor

Story.kentenStrokeColor

ParagraphStyle.kentenStrokeColor

XmlStory.kentenStrokeColor

FindTextPreference.kentenStrokeColor

FindGrepPreference.kentenStrokeColor

FindTransliteratePreference.kentenStrokeColor

ChangeTextPreference.kentenStrokeColor

ChangeGrepPreference.kentenStrokeColor

ChangeTransliteratePreference.kentenStrokeColor

CharacterStyle.kentenStrokeColor

TextDefault.rubyStroke

Text.rubyStroke

Character.rubyStroke

Word.rubyStroke

Line.rubyStroke

TextColumn.rubyStroke

Paragraph.rubyStroke

TextStyleRange.rubyStroke

InsertionPoint.rubyStroke

Story.rubyStroke

ParagraphStyle.rubyStroke

XmlStory.rubyStroke

FindTextPreference.rubyStroke

FindGrepPreference.rubyStroke

FindTransliteratePreference.rubyStroke

ChangeTextPreference.rubyStroke

ChangeGrepPreference.rubyStroke

ChangeTransliteratePreference.rubyStroke

CharacterStyle.rubyStroke

Button.strokeColor

ChangeObjectPreference.strokeColor

Character.strokeColor

CharacterStyle.strokeColor

CheckBox.strokeColor

ComboBox.strokeColor

EPS.strokeColor

EPSText.strokeColor

EndnoteTextFrame.strokeColor

FindObjectPreference.strokeColor

FormField.strokeColor

Graphic.strokeColor

GraphicLine.strokeColor

Group.strokeColor

HtmlItem.strokeColor

Image.strokeColor

ImportedPage.strokeColor

InsertionPoint.strokeColor

Line.strokeColor

ListBox.strokeColor

MediaItem.strokeColor

Movie.strokeColor

MultiStateObject.strokeColor

ObjectStyle.strokeColor

Oval.strokeColor

PDF.strokeColor

PICT.strokeColor

PageItem.strokeColor

PageItemDefault.strokeColor

Paragraph.strokeColor

ParagraphStyle.strokeColor

Polygon.strokeColor

RadioButton.strokeColor

Rectangle.strokeColor

SignatureField.strokeColor

Sound.strokeColor

SplineItem.strokeColor

Story.strokeColor

StrokeFillProxySetting.strokeColor

Text.strokeColor

TextBox.strokeColor

TextColumn.strokeColor

TextDefault.strokeColor

TextFrame.strokeColor

TextStyleRange.strokeColor

WMF.strokeColor

Word.strokeColor

XmlStory.strokeColor

FootnoteOption.ruleColor

Cell.topEdgeStrokeColor

Column.topEdgeStrokeColor

Row.topEdgeStrokeColor

CellStyle.topEdgeStrokeColor

TextDefault.underlineColor

Text.underlineColor

Character.underlineColor

Word.underlineColor

Line.underlineColor

TextColumn.underlineColor

Paragraph.underlineColor

TextStyleRange.underlineColor

InsertionPoint.underlineColor

Story.underlineColor

ParagraphStyle.underlineColor

XmlStory.underlineColor

FindTextPreference.underlineColor

FindGrepPreference.underlineColor

FindTransliteratePreference.underlineColor

ChangeTextPreference.underlineColor

ChangeGrepPreference.underlineColor

ChangeTransliteratePreference.underlineColor

CharacterStyle.underlineColor

Application.unusedSwatches

Document.unusedSwatches

ColorGroupSwatch.swatchItemRef

Return

Swatch.duplicate()

MixedInk.merge()

MixedInkGroup.merge()

Gradient.merge()

Swatch.merge()

Color.merge()

Tint.merge()

Swatch.getElements()

Swatches.anyItem()

Swatches.everyItem()

Swatches.nextItem()

Swatches.previousItem()

Swatches.itemByID()

Swatches.item()

Swatches.[]()

Swatches.itemByName()

Swatches.itemByRange()

Swatches.firstItem()

Swatches.lastItem()

Swatches.middleItem()