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() None ¶
Delete this article. The content of the article is retained.
- Return type:
None
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CArticle.getName() str ¶
Get the name of this article.
- Returns:
The article name.
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CArticle.setName(name: str) None ¶
Set the name of this article.
- Parameters:
name (str) – The new name. Must not be empty.
- Raises:
TypeError – When parameter types are invalid.
ValueError – When parameter name is empty.
CometError – On internal error.
- Return type:
None
- Available:
InDesign® comet_pdf®
- CScript:
- CArticle.getIndex() int ¶
Get the index of this article in the article list.
- Returns:
The article index.
- Type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CArticle.setIndex(index: int) None ¶
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:
TypeError – When parameter types are invalid.
ValueError – When parameter name is empty.
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CArticle.getUseForExport() bool ¶
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:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CArticle.setUseForExport(use: bool = True) None ¶
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:
TypeError – When parameter types are invalid.
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CArticle.getMembers() list[CPageItem] ¶
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:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CArticle.addMembers(members: list[CPageItem]) None ¶
Add new members to this article.
The members are appended to the existing members.
- Parameters:
- Return type:
None
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CArticle.getMemberIndex(member: CPageItem) int ¶
Get the index of a member of the article.
- Returns:
The member index
- Return type:
- Raises:
TypeError – When parameter types are invalid.
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CArticle.setMemberIndex(member: CPageItem, index: int) None ¶
Set the index of a member of the article.
- Parameters:
- Return type:
None
- Raises:
TypeError – When parameter types are invalid.
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CArticle.removeMembers(members: list[CPageItem] | list[int]) None ¶
Remove a member from an article.
The item itself is not deleted.