comet.CArticle

class comet.CArticle

CArticle is an article used for document structuring.

In InDesign®, objects of this class represent an entry in the articles panel.

Methods

CArticle.remove()

Delete this article. The content of the article is retained.

Return type:

None

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf®

CScript:

document::article::remove

CArticle.getName()

Get the name of this article.

Returns:

The article name.

Return type:

str

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf®

CScript:

document::article::get_name

CArticle.setName(name)

Set the name of this article.

Parameters:

name (str) – The new name. Must not be empty.

Raises:
Return type:

None

Available:

InDesign® comet_pdf®

CScript:

document::article::set_name

CArticle.getIndex()

Get the index of this article in the article list.

Returns:

The article index.

Type:

int

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf®

CScript:

document::article::get_pos

CArticle.setIndex(index)

Set the index of this article in the article list.

Parameters:

index (int) – The new article index. When this parameter value is out of bounds (< 0 or >= count), the article is moved to the end.

Return type:

None

Raises:
Available:

InDesign® comet_pdf®

CScript:

document::article::set_pos

CArticle.getUseForExport()

Get whether the article added to the accessibility tags.

The function queries the Include article when exporting setting, which is displayed when an article is double-clicked in the articles panel.

Returns:

Whether the option is enabled.

Return type:

bool

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf®

CScript:

document::article::get_use_for_export

CArticle.setUseForExport(use=True)

Set whether the article should be included in the export. The function sets the Include article when exporting setting, which can be set when double-clicking an article in the article panel.

Parameters:

use (bool) – Whether the option should be enabled.

Raises:
Available:

InDesign® comet_pdf®

CScript:

document::article::set_use_for_export

CArticle.getMembers()

Create a list of all elements (members) of this article. The list usually contains the document frames whose contents form the article.

Returns:

A list of the members.

Return type:

list[CPageItem]

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf®

CScript:

document::article::get_members

CArticle.addMembers(members)

Add new members to this article.

The members are appended to the existing members.

Parameters:

members (list[CPageItem]) – The members to append.

Return type:

None

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf®

CScript:
CArticle.getMemberIndex(member)

Get the index of a member of the article.

Returns:

The member index

Return type:

int

Raises:
Available:

InDesign® comet_pdf®

CScript:

document::article::member::get_pos

CArticle.setMemberIndex(member, index)

Set the index of a member of the article.

Parameters:
  • member (CPageItem) – The member to move.

  • index (int) – The new member index.

Return type:

None

Raises:
Available:

InDesign® comet_pdf®

CScript:

document::article::member::set_pos

CArticle.removeMembers(members)

Remove a member from an article.

The item itself is not deleted.

Parameters:

members (list[CPageItem] | list[int]) –

The members to remove.

The parameter type can be:

Return type:

None

Raises:
Available:

InDesign® comet_pdf®

CScript:

document::article::member::remove

Special methods

CArticle.__repr__()

String representation.

Returns:

<CArticle> Name: Name | Member count: Member count

Member 0 UID: Member 0 UID

[Member n UID: Member n UID]

Example
<CArticle> Name: Artikel 1 | Member count: 2
Member 0 UID: 292
Member 1 UID: 246

Return type:

str