comet.pagetemplate

The comet.pagetemplate module provides access to page template information by querying the data pool.

Methods

comet.pagetemplate.getInfo(ID, attribute)

Determine the properties of a page template defined in the current data pool.

Parameters:
Returns:

The attribute value. The data type depends on the parameter attribute.

Return type:

bool | int | str

Raises:
  • TypeError – When parameter types are invalid.

  • ValueError

    • When parameter ID is < 0.

    • When parameter attribute contains invalid value.

  • CometError – On internal error.

Available:

InDesign® comet_pdf®

CScript:

page::templates::get_info

comet.pagetemplate.getElementCount(ID)

Get the number of elements (frames) in a page template of the data pool.

Parameters:

ID (int) – The ID of the page template in the data pool.

Returns:

The number of page elements in the page template.

Return type:

int

Raises:
Available:

InDesign® comet_pdf®

CScript:

page::templates::count_elements

comet.pagetemplate.getElementInfo(ID, index, attribute, bySequence=True)

Determine the properties of a page element of a page template defined.

Parameters:
  • ID (int) – The ID of the page template in the data pool.

  • index (int) –

    Which page element to query.

    The element to query can be either determined by its’ sequence number (bySequence == True) or index (bySequence == False).

  • attribute (int) – The attribute to get.

    One of Page element attributes.

  • bySequence (bool) –

    • True: The parameter index is used as the page element’s sequence number.

    • False: The parameter index is used as the page element’s index.

Returns:

The attribute value. The data type depends on the parameter attribute.

Return type:

bool | int | float | str

Raises:
  • TypeError – When parameter types are invalid.

  • ValueError

    • When parameter index is < 0.

    • When parameter attribute has invalid value.

Available:

InDesign® comet_pdf®

CScript: