BuildingBlocks

A collection of cross reference building blocks.

Methods:

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

Property Listing

Property

Type

Access

Description

length

Number

readonly

The number of objects in the collection.

Method Listing

BuildingBlock [] (index:Number)

Returns the BuildingBlock with the specified index.

Parameter

Type

Description

index

Number

The index.

BuildingBlock add (blockType:BuildingBlockTypes, appliedCharacterStyle:CharacterStyle, customText:String, withProperties:Object)

Creates a new cross reference building block.

Parameter

Type

Description

blockType

BuildingBlockTypes

BuildingBlockTypes.BOOKMARK_NAME_BUILDING_BLOCK

BuildingBlockTypes.CHAPTER_NUMBER_BUILDING_BLOCK

BuildingBlockTypes.CUSTOM_STRING_BUILDING_BLOCK

BuildingBlockTypes.FILE_NAME_BUILDING_BLOCK

BuildingBlockTypes.FULL_PARAGRAPH_BUILDING_BLOCK

BuildingBlockTypes.PAGE_NUMBER_BUILDING_BLOCK

BuildingBlockTypes.PARAGRAPH_NUMBER_BUILDING_BLOCK

BuildingBlockTypes.PARAGRAPH_TEXT_BUILDING_BLOCK

Type of the building block.

appliedCharacterStyle

CharacterStyle

Character style to be applied to the building block. (Optional)

customText

String

Building block custom text. Currently this is only useful in custom string building block. It is ignored for other types of building blocks. (Optional)

withProperties

Object

Initial values for properties of the new BuildingBlock (Optional)

BuildingBlock anyItem ()

Returns any BuildingBlock in the collection.

Number count ()

Displays the number of elements in the BuildingBlock.

BuildingBlock everyItem ()

Returns every BuildingBlock in the collection.

BuildingBlock firstItem ()

Returns the first BuildingBlock in the collection.

BuildingBlock item (index:Varies LongInteger String)

Returns the BuildingBlock with the specified index or name.

Parameter

Type

Description

index

LongInteger

String

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

BuildingBlock itemByRange (from:Varies BuildingBlock LongInteger String, to:Varies BuildingBlock LongInteger String)

Returns the BuildingBlocks within the specified range.

Parameter

Type

Description

from

BuildingBlock

LongInteger

String

The BuildingBlock, index, or name at the beginning of the range. Can accept: BuildingBlock, Long Integer or String.

to

BuildingBlock

LongInteger

String

The BuildingBlock, index, or name at the end of the range. Can accept: BuildingBlock, Long Integer or String.

BuildingBlock lastItem ()

Returns the last BuildingBlock in the collection.

BuildingBlock middleItem ()

Returns the middle BuildingBlock in the collection.

BuildingBlock nextItem (obj:BuildingBlock)

Returns the BuildingBlock whose index follows the specified BuildingBlock in the collection.

Parameter

Type

Description

obj

BuildingBlock

The BuildingBlock whose index comes before the desired BuildingBlock.

BuildingBlock previousItem (obj:BuildingBlock)

Returns the BuildingBlock with the index previous to the specified index.

Parameter

Type

Description

obj

BuildingBlock

The index of the BuildingBlock that follows the desired BuildingBlock.

String toSource ()

Generates a string which, if executed, will return the BuildingBlock.

Object of

CrossReferenceFormat.buildingBlocks