Adobe InDesign CS4 (6.0) Object Model JS: TextVariable

InDesign CS4

Class

TextVariable

 A text variable definition in a document.

QuickLinks

convertToText, getElements, remove, toSource, toSpecifier

Hierarchy

Application | Document
TextVariable
ChapterNumberVariablePreference | CustomTextVariablePreference | DateVariablePreference | FileNameVariablePreference | MatchCharacterStylePreference | MatchParagraphStylePreference | PageNumberVariablePreference

Properties

PropertyTypeAccessDescription
associatedInstancesArray of TextVariableInstance readonlyVariable instances associated with the text variable.
indexnumber readonlyThe index of the TextVariable within its containing object.
isValidbool readonlyReturns true if the object specifier resolves to valid objects.
namestring r/wThe name of the TextVariable.
parentApplicationDocument readonlyThe parent of the TextVariable (a Application or Document).
propertiesObject r/wA property that allows setting of several properties at the same time.
variableOptionsChapterNumberVariablePreference
CustomTextVariablePreference
DateVariablePreference
FileNameVariablePreference
MatchCharacterStylePreference
MatchParagraphStylePreference
PageNumberVariablePreference
readonlyThe preferences associated with the text variable. Can return: PageNumberVariablePreference, ChapterNumberVariablePreference, DateVariablePreference, FileNameVariablePreference, MatchCharacterStylePreference, MatchParagraphStylePreference or CustomTextVariablePreference.
variableTypeVariableTypes:
VariableTypes.CUSTOM_TEXT_TYPE
VariableTypes.FILE_NAME_TYPE
VariableTypes.LAST_PAGE_NUMBER_TYPE
VariableTypes.CHAPTER_NUMBER_TYPE
VariableTypes.OUTPUT_DATE_TYPE
VariableTypes.CREATION_DATE_TYPE
VariableTypes.MODIFICATION_DATE_TYPE
VariableTypes.MATCH_CHARACTER_STYLE_TYPE
VariableTypes.MATCH_PARAGRAPH_STYLE_TYPE
VariableTypes.XREF_PAGE_NUMBER_TYPE
VariableTypes.XREF_CHAPTER_NUMBER_TYPE
r/wThe variable type.

Methods

Instances

Array of Text convertToText ()
Convert all of this variable's instances to text.

Array of TextVariable getElements ()
Resolves the object specifier, creating an array of object references.

void remove ()
Deletes the TextVariable.

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

string toSpecifier ()
Retrieves the object specifier.

Element of

ChapterNumberVariablePreference.parent

CustomTextVariablePreference.parent

DateVariablePreference.parent

FileNameVariablePreference.parent

MatchCharacterStylePreference.parent

MatchParagraphStylePreference.parent

PageNumberVariablePreference.parent

TextVariableInstance.associatedTextVariable

Used in:

array of TextVariable TextVariables.itemByRange (from: any, to: any)

TextVariable TextVariables.nextItem (obj: TextVariable)

TextVariable TextVariables.previousItem (obj: TextVariable)

Return

Array of TextVariable TextVariable.getElements ()

TextVariable TextVariables.[] (index: number)

TextVariable TextVariables.add ([withProperties: Object])

TextVariable TextVariables.anyItem ()

Array of TextVariable TextVariables.everyItem ()

TextVariable TextVariables.firstItem ()

TextVariable TextVariables.item (index: any)

TextVariable TextVariables.itemByName (name: string)

Array of TextVariable TextVariables.itemByRange (from: any, to: any)

TextVariable TextVariables.lastItem ()

TextVariable TextVariables.middleItem ()

TextVariable TextVariables.nextItem (obj: TextVariable)

TextVariable TextVariables.previousItem (obj: TextVariable)

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