comet.CHyperlinkSource

class comet.CHyperlinkSource

Methods

CHyperlinkSource.isValid()

Determine whether this hyperlink destination is still valid and exists

Returns:

Whether this hyperlink destination is still valid and exists

Return type:

bool

Available:

InDesign® comet_pdf®

CScript:

hyperlink::is_valid

CHyperlinkSource.getDocument()

Get the document this destination belongs to

Returns:

The owning document

Return type:

CDocument

Raises:

CometError – When the source is not valid

Available:

InDesign® comet_pdf®

CHyperlinkSource.getType()

Determine the type of this hyperlink source

Returns:

The hyperlink source type

  • 0: Frame

  • 1: Text

Return type:

int

Raises:

CometError – When the source is not valid

Available:

InDesign®

CHyperlinkSource.getFrame()

Get the frame this source is attached to.

Return type:

int

Raises:
  • TypeError – When the source is not attached to a frame

  • CometError – When the source is not valid

Available:

InDesign®

CHyperlinkSource.getTextModel()

Get the textmodel this source is attached to.

Returns:

The textmodel

Return type:

int

Raises:
  • TypeError – When the source is not attached to a text

  • CometError – When the source is not valid

Available:

InDesign®

CHyperlinkSource.getStart()

Get the text index this source starts at.

The result is the global index in the text model this source starts at.

Returns:

The start text index

Return type:

int

Raises:
  • TypeError – When the source is not attached to a text

  • CometError – When the source is not valid

Available:

InDesign®

CHyperlinkSource.getLength()

Get the text length of this source.

Returns:

The source text length

Return type:

int

Raises:
  • TypeError – When the source is not attached to a text

  • CometError – When the source is not valid

Available:

InDesign®

Get the link this source is attached to.

Returns:

The link of this source

Return type:

CHyperlink

Raises:

CometError – When the source is not valid

Available:

InDesign®

Special methods

CHyperlinkSource.__repr__()

String representation.

Returns:

For getType() == 0 (Frame):

<CHyperlinkSource> Type: Frame | UID: Frame UID

For getType() == 1 (Text):

<CHyperlinkSource> Type: Text | Start: Start | Length: Length

Example (Frame)
<CHyperlinkSource> Type: Frame | UID: 328
Example (Text)
<CHyperlinkSource> Type: Text | Start: 10 | Length: 4

Return type:

str