comet.CBookmark¶
- class comet.CBookmark¶
See also
Module hyperlink
Methods¶
- CBookmark.isValid()¶
Determine whether this bookmark is still valid and exists in a document. A bookmark may be invalid e.g. when it is deleted from the owning document by calling
remove()
- Returns:
Whether the frame is still valid
- Return type:
- Available:
InDesign® comet_pdf®
- CScript:
- CBookmark.getDocument()¶
Get the document this bookmark belongs to.
- Returns:
The document
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CBookmark.getName()¶
Get the name of this bookmark.
- Returns:
The name
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CBookmark.setName(name)¶
Change the name of this bookmark.
- Parameters:
name (str) – The new name
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter name is empty str
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CBookmark.getDepth()¶
Get the nesting level of this bookmark.
- Returns:
The 0-based nesting level
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CBookmark.getIndex()¶
Get the index of this bookmark at the local nesting level.
- Returns:
The 0-based local index
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CBookmark.setIndex(index)¶
Change this bookmark’s index inside the parent level.
- Parameters:
index (int) –
The new local index.
The value is clamped to valid values:
< 0 or > max index: Last
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- See also:
- CBookmark.getParent()¶
Get the parent bookmark of this bookmark.
May return
None
when this bookmark is at the top level.- Returns:
The parent bookmark
- Return type:
CBookmark | None
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CBookmark.setParent(parent, index=-1)¶
Change the parent of this bookmark.
- Parameters:
parent –
The new parent bookmark.
Of course this must be a valid parent, e.g. parenting underneath a child of itself is not possible.
The parameter type can be:
index (int) –
The new local index.
The value is clamped to valid values:
< 0 or > max index: Last
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CBookmark.getChildren(recursive=False, name='')¶
Get childen of this bookmark.
- Parameters:
- Returns:
The child bookmarks
- Return type:
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CBookmark.setColor(color)¶
Change the font color of this bookmark.
- Parameters:
color (CSwatch) –
The new color.
Must be in color model
constants.kColorModelRGB
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
comet_pdf®
- CScript:
- CBookmark.createBookmark(pageDestination, name, index=-1)¶
Create a new bookmark as a child of this one.
- Parameters:
- Returns:
The newly created bookmark
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter name is empty
- Available:
InDesign® comet_pdf®
- CScript:
- CBookmark.remove()¶
Remove this bookmark from the document.
All subsequent calls to this bookmarks’s functions will fail.
- Return type:
None
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript: