comet.CLink¶
- class comet.CLink¶
This section describes all functions for the comet.CLink class.
A CLink object describes a placeholder which is set inside a document.
A single CLink object corresponds to a single text placeholder or frame placeholder. CLink objects provide queries for getting placeholder information, product information and content they can access like text or images.
See also
- Module
link
Functionality for fetching document links
Methods¶
- CLink.getFrame()¶
Get the frame this link belongs to.
For text placeholders this is the containing frame. When the text placeholder is (partially) in overset, the return value is the first frame of the text chain, else it is the text frame which fully contains the link.
- Returns
The frame
- Return type
- Available
- CScript
- CLink.getLayer()¶
Get the layer this link is on.
- Returns
The layer
- Return type
- Available
- CScript
- CLink.getType()¶
Get the type of this link.
- Returns
The link type. One of Link types
- Return type
- Available
- CLink.getRecordID()¶
Gets the record ID of the link.
- CLink.getPlaceHolderID()¶
Get the ID of the placeholder of this link.
- Returns
The placeholder ID
- Return type
- Available
- CScript
- CLink.getPosition()¶
Get the text start position for this link. For frame placeholders the result is always 0.
- CLink.getLength()¶
Get the text length of the link in the document. For frame placeholders the result is always -1.
- Returns
The text length this link governs
- Return type
- Available
- CScript
- CLink.getContent(position=0, length=- 1, format=0)¶
Get the text of the link.
- Parameters
position (int) –
Start position.
Only evaluated for frame placeholders.
length (int) –
Number of characters to fetch.
Default is
comet.kEnd
== until the end.Only evaluated for frame placeholders.
format (int) –
The export format.
See Text formats.
- Returns
The link’s text
- Return type
- Raises
TypeError – When parameter types are invalid
ValueError – When parameter position, length or format has invalid Value
CometError – On internal error
- Available
- See also
- CScript
- CLink.getSyncState()¶
Get the sync state of the link.
- Returns
The link’s sync state. One of Sync states
- Return type
- Available
- CScript
- CLink.getFuncVars(actionType)¶
Get the function variables of the link.
- Parameters
actionType (int) –
The action to get the function variables for.
One of Action types
- Returns
Funcvars as key/value pairs
- Return type
- Raises
TypeError – When parameter types are invalid
ValueError – When parameter actionType has invalid Value
CometError – On internal error
- Available
- CScript
- CLink.getPrefix()¶
Get the current prefix of the placeholder.
- Returns
The prefix
- Return type
- Available
- CScript
- CLink.getPrefixIfEmpty()¶
Get the current prefix of the placeholder if it is empty.
- Returns
The prefix if empty
- Return type
- Available
- CScript
- CLink.getPostfix()¶
Get the current postfix of the placeholder.
- Returns
The postfix
- Return type
- Available
- CScript
- CLink.getPostfixIfEmpty()¶
Get the current postfix of the placeholder if it is empty.
- Returns
The postfix if empty
- Return type
- Available
- CScript