comet.CGroup

class comet.CGroup
Inherits:

comet.CPageItem

Methods

CGroup.getGroup()

Get the parent group this group belongs to, if any.

Returns

The group if one exists, else None

Return type

CGroup | None

Raises

CometError – On internal error

Available

CScript

frame::get_group

CGroup.getMembers()

Get the members of this group.

Returns

The group members

Return type

list[CFrame | CGroup]

Raises

CometError – On internal error

Available

CScript

frame::group_content

CGroup.addMembers(objects)

Add new members to this group.

Due to a limitation in the InDesign® SDK, this recreates the group, causing the UID to change.

Parameters

objects (list[CFrame | CGroup]) – The new members to add.

Raises

TypeError – When parameter types are invalid

Available

CScript
CGroup.removeMembers(objects)

Remove members from this group, parenting them directly below the group at above level in the document hierarchy.

The original order in the group is preserved.

When the group would contain zero or one entries afterwards, it is automatically resolved. This leaves this object in an invalid state.

Parameters

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

The objects to remove.

The parameter type can be:

  • int

    A single index to remove. Can be negative to remove at the end.

  • tuple [int, int]

    Index to remove at, count to remove. When index is negative, removing will happen at the last index in backwards direction. Count must be >= 1.

Return type

None

Raises
Available

CGroup.resolve()

Resolve this group by placing all members underneath the next parent group beginning at the index of this group, or the root.

Members are not deleted from the document.

All subsequent calls to this object’s functions will fail.

Return type

None

Raises

CometError – On internal error

Available

CScript

frame::ungroup