Adobe InDesign CS4 (6.0) Object Model JS: CharacterStyles

InDesign CS4

Class

CharacterStyles

 A collection of character styles.

QuickLinks

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

Properties

PropertyTypeAccessDescription
lengthLong Integer
NothingEnum
readonlyThe number of objects in the collection. Can return: Long Integer or NothingEnum enumerator.

Methods

Instances

CharacterStyle [] (index: number)
Returns the CharacterStyle with the specified index.

ParameterTypeDescription
indexnumberThe index.

CharacterStyle add ([withProperties: Object])
Creates a new CharacterStyle.

ParameterTypeDescription
withPropertiesObjectInitial values for properties of the new CharacterStyle (Optional)

CharacterStyle anyItem ()
Returns any CharacterStyle in the collection.

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

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

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

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

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

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

ParameterTypeDescription
idnumberThe ID.

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

ParameterTypeDescription
namestringThe name.

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

ParameterTypeDescription
fromCharacterStyle
Long Integer
String
The CharacterStyle, index, or name at the beginning of the range. Can accept: CharacterStyle, Long Integer or String.
toCharacterStyle
Long Integer
String
The CharacterStyle, index, or name at the end of the range. Can accept: CharacterStyle, Long Integer or String.

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

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

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

ParameterTypeDescription
objCharacterStyleThe CharacterStyle whose index comes before the desired CharacterStyle.

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

ParameterTypeDescription
objCharacterStyleThe index of the CharacterStyle that follows the desired CharacterStyle.

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

Element of

Application.characterStyles

CharacterStyleGroup.characterStyles

Document.characterStyles

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