TextVariable

A text variable definition in a document.

Methods:

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

Objects:

Boolean, CaptionMetadataVariablePreference, ChapterNumberVariablePreference, CustomTextVariablePreference, DateVariablePreference, EventListeners, Events, FileNameVariablePreference, MatchCharacterStylePreference, MatchParagraphStylePreference, Number, Object, PageNumberVariablePreference, Preferences, String, TextVariableInstance, VariableTypes,

Preferences:

CaptionMetadataVariablePreference, ChapterNumberVariablePreference, CustomTextVariablePreference, DateVariablePreference, FileNameVariablePreference, MatchCharacterStylePreference, MatchParagraphStylePreference, PageNumberVariablePreference, Preferences,

Property Listing

Property

Type

Access

Description

associatedInstances

Array of TextVariableInstance

readonly

Variable instances associated with the text variable.

eventListeners

EventListeners EventListener

readonly

A collection of event listeners.

events

Events Event

readonly

A collection of events.

index

Number

readonly

The index of the TextVariable within its containing object.

isValid

Boolean

readonly

Returns true if the object specifier resolves to valid objects.

name

String

read/write

The name of the TextVariable.

parent

Application

Document

readonly

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

preferences

Preferences Preference

readonly

A collection of preferences objects.

properties

Object

read/write

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

variableOptions

ChapterNumberVariablePreference

CustomTextVariablePreference

DateVariablePreference

FileNameVariablePreference

MatchCharacterStylePreference

MatchParagraphStylePreference

PageNumberVariablePreference

CaptionMetadataVariablePreference

readonly

The preferences associated with the text variable. Can return: PageNumberVariablePreference, ChapterNumberVariablePreference, DateVariablePreference, FileNameVariablePreference, MatchCharacterStylePreference, MatchParagraphStylePreference, CustomTextVariablePreference or CaptionMetadataVariablePreference.

variableType

VariableTypes

VariableTypes.CHAPTER_NUMBER_TYPE

VariableTypes.CREATION_DATE_TYPE

VariableTypes.CUSTOM_TEXT_TYPE

VariableTypes.FILE_NAME_TYPE

VariableTypes.LAST_PAGE_NUMBER_TYPE

VariableTypes.LIVE_CAPTION_TYPE

VariableTypes.MATCH_CHARACTER_STYLE_TYPE

VariableTypes.MATCH_PARAGRAPH_STYLE_TYPE

VariableTypes.MODIFICATION_DATE_TYPE

VariableTypes.OUTPUT_DATE_TYPE

VariableTypes.XREF_CHAPTER_NUMBER_TYPE

VariableTypes.XREF_PAGE_NUMBER_TYPE

read/write

The variable type.

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)

Text convertToText ()

Convert all of this variable's instances to text.

TextVariable getElements ()

Resolves the object specifier, creating an array of object references.

undefined remove ()

Deletes the TextVariable.

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

String toSpecifier ()

Retrieves the object specifier.

Object of

TextVariableInstance.associatedTextVariable

CaptionMetadataVariablePreference.parent

ChapterNumberVariablePreference.parent

CustomTextVariablePreference.parent

DateVariablePreference.parent

Event.parent

EventListener.parent

FileNameVariablePreference.parent

MatchCharacterStylePreference.parent

MatchParagraphStylePreference.parent

MutationEvent.parent

PageNumberVariablePreference.parent

Preference.parent

Return

TextVariables.add()

TextVariable.getElements()

TextVariables.anyItem()

TextVariables.everyItem()

TextVariables.nextItem()

TextVariables.previousItem()

TextVariables.item()

TextVariables.[]()

TextVariables.itemByName()

TextVariables.itemByRange()

TextVariables.firstItem()

TextVariables.lastItem()

TextVariables.middleItem()