Adobe InCopy CS5 (7.0) Object Model JS: TextVariable

InCopy CS5

Class

TextVariable

 A text variable definition in a document.

QuickLinks

addEventListener, convertToText, getElements, remove, removeEventListener, toSource, toSpecifier

Hierarchy

Application | Document
TextVariable
CaptionMetadataVariablePreference | ChapterNumberVariablePreference | CustomTextVariablePreference | DateVariablePreference | Event | EventListener | FileNameVariablePreference | MatchCharacterStylePreference | MatchParagraphStylePreference | MutationEvent | PageNumberVariablePreference | Preference

Properties

PropertyTypeAccessDescription
associatedInstances Array of TextVariableInstance readonlyVariable instances associated with the text variable.
eventListenersEventListeners readonlyA collection of event listeners.
eventsEvents readonlyA collection of events.
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).
preferencesPreferences readonlyA collection of preferences objects.
propertiesObject r/wA property that allows setting of several properties at the same time.
variableOptionsCaptionMetadataVariablePreference
ChapterNumberVariablePreference
CustomTextVariablePreference
DateVariablePreference
FileNameVariablePreference
MatchCharacterStylePreference
MatchParagraphStylePreference
PageNumberVariablePreference
readonlyThe preferences associated with the text variable. Can return: PageNumberVariablePreference, ChapterNumberVariablePreference, DateVariablePreference, FileNameVariablePreference, MatchCharacterStylePreference, MatchParagraphStylePreference, CustomTextVariablePreference or CaptionMetadataVariablePreference.
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
VariableTypes.LIVE_CAPTION_TYPE
r/wThe variable type.

Methods

Instances

EventListener addEventListener (eventType: string, handler: varies[, captures: bool=false])
Adds an event listener.

ParameterTypeDescription
eventTypestringThe event type.
handlerFile
JavaScript Function
The event handler. Can accept: File or JavaScript Function.
capturesboolThis parameter is obsolete. (Optional) (default: false)

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.

bool removeEventListener (eventType: string, handler: varies[, captures: bool=false])
Removes the event listener.

ParameterTypeDescription
eventTypestringThe registered event type.
handlerFile
JavaScript Function
The registered event handler. Can accept: File or JavaScript Function.
capturesboolThis parameter is obsolete. (Optional) (default: false)

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

string toSpecifier ()
Retrieves the object specifier.

Element of

CaptionMetadataVariablePreference.parent

ChapterNumberVariablePreference.parent

CustomTextVariablePreference.parent

DateVariablePreference.parent

FileNameVariablePreference.parent

MatchCharacterStylePreference.parent

MatchParagraphStylePreference.parent

PageNumberVariablePreference.parent

TextVariableInstance.associatedTextVariable

Used in:

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: varies)

TextVariable TextVariables.itemByName (name: string)

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

TextVariable TextVariables.lastItem ()

TextVariable TextVariables.middleItem ()

TextVariable TextVariables.nextItem (obj: TextVariable)

TextVariable TextVariables.previousItem (obj: TextVariable)

Jongware, 23-Mar-2011 v3.0.3dContents :: Index