comet.CGroup

class comet.CGroup
Inherits:

comet.CPageItem

Inherited methods

CGroup.getUID()

Get the UID of this item as an int.

Returns:

The UID of this item

Return type:

int

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf®

CScript:

item::getint

CGroup.getType()

Determine the type of the item.

Returns:

The type of the item.

One of Pageitem types

Return type:

int

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:
CGroup.getDocument()

Get the document this item belongs to.

Returns:

The document

Return type:

CDocument

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CGroup.getPage(queryNearest=False)

Get the page this item is on.

Parameters:

queryNearest (bool) – When the item is not on a page find the closest page?

Returns:

The page the item is on

Return type:

CPage

Raises:
Available:

InDesign® comet_pdf® Illustrator®

CScript:

page::get

CGroup.getLayer()

Get the layer this item is on.

Returns:

The item’s layer

Return type:

CLayer

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::get_layer

CGroup.setLayer(layer, moveGroup=False, ignoreLayerLocks=False)

Move this item to another layer.

Parameters:
  • layer (str | list[str] | int | CLayer) –

    The new target layer.

    The parameter type can be:

    • str

      Name of a top level layer.

    • list [str]

      Nested layer path.

    • int

      Top level layer index counting from the bottom.

    • CLayer

      Layer. Must be in the same document as this item.

  • moveGroup (bool) –

    • True: In case of sub or inline frames, the topmost item is moved instead.

    • False: Do not move sub or inline frames. The function will raise CometError in this case.

  • ignoreLayerLocks (bool) –

    Allow moving from and to locked layers?

    • TrueIgnore all layer locks.

      Attention : This may change te current document selection

    • False : Do not move items from or to locked layers.

Return type:

None

Raises:
  • TypeError – When parameter types are invalid

  • ValueError – When parameter layer is empty str or invalid int or None

  • CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:
CGroup.getParent()

Get the parent (e.g. containing frame) of this page item if one exists.

Returns:

The parent item or None if none exists.

Return type:

CPageItem | None

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::parent

CGroup.getName(nameType=0, translate=False)

Get the name of this item as displayed in the layer panel.

Parameters:
  • nameType (int) –

    The kind of name to retrieve.

    • 0: User defined name. If empty return the default name.

    • 1: Default name

    • 2: User defined name. If not set the result string is empty

  • translate (bool) –

    Translate the default name?

    InDesign® The internal untranslated name of an empty graphic frame is #Graphicframe. This is translated to Graphic frame by an English version of InDesign®.

    Illustrator® Ignored

Returns:

The name of this frame

Return type:

str

Raises:
Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::get_name

CGroup.setName(name)

Set the name of this item.

Parameters:

name (str) –

The new name.

  • Empty str: Reset to default name.

Raises:

TypeError – When parameter types are invalid

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::set_name

CGroup.getBBox(spreadRelative=False)

Get the bounding box of this item.

Parameters:

spreadRelative (bool) –

Get the coordinates relative to the page or to the spread the item is on?

Illustrator® Ignored

Returns:

The bounding box

Return type:

CRect

Raises:

TypeError – When parameter types are invalid

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::bbox

CGroup.moveTo(x, y, page=-1, executeLayoutRules=False, refPoint=0, useBBox=True)

Move a frame to new coordinates. The frame may also be moved to another page. The new position is the position of the left upper corner of the frame’s bounding box.

Parameters:
  • x (float) – The new X position

  • y (float) – The new Y position

  • page

    Move frames to another page?

    The parameter type can be:

    When the parameter is -1, the page is unchanged.

  • executeLayoutRules (bool) –

    Execute layout rules “After geometry changes” while executing the command?

    • TrueYes, execute rules “after geometry” changes.

      This may cause problems and/or side effects like infinite recursion!

    • False : No, supress rules if any.

  • refPoint (int) –

    The reference point to move to the new coordinates.

    One of Reference Points.

    Default is constants.kRefPointTopLeft.

    InDesign® comet_pdf® Ignored. The left top point is always used.

  • useBBox (bool) –

    Whether to move the reference point of the bounding box or the actual item.

    • True: Move reference point of bounding box to the new coordinates.

    • False: Move the actual reference point of the page item to the new coordinates.

    InDesign® comet_pdf® Ignored. The parameter is always true.

Returns:

None

Raises:
Available:

InDesign® comet_pdf® Illustrator®

See also:

frame.moveTo()

CScript:

frame::moveto

CGroup.getSize(boundsKind=0)

Get the size of this page item.

Parameters:

boundsKind (int) –

Which bounds to get:

  • 0: Frame with stroke

  • 1: Frame without stroke

Returns:

tuple of (width, height)

Return type:

tuple[float, float]

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::get_size

CGroup.setSize(width=-1.0, height=-1.0, boundsKind=0, refPoint=0, offsetX=0.0, offsetY=0.0, executeLayoutRules=False)

Change the size of this page item.

Page items must be greater than 0.0 Points and must not be smaller than the strokes at both sides.

So a page item with a stroke of 10 points must have a size of at least 20 points.

InDesign®

  • If strokes avoid page item resizing, the function tries to reduce the stroke at first.

  • Lines are treated differently by InDesign®: Slanted lines can become orthogonal lines. But orthogonal lines can only change their length. The attempt to turn orthogonal lines into slanted lines is rejected by InDesign® with the error kIllegalDimensionErr (11269)

  • Points are ignored by the function without errors.

Parameters:
  • width (float) –

    New frame width

    • -1.0: Leave unchanged

  • height (float) –

    New frame height

    • -1.0: Leave unchanged

  • boundsKind (int) –

    Which bounds to set:

    • 0: Frame with stroke

    • 1: Frame without stroke

    Illustrator® Ignored. The value is always 1

  • refPoint (int) –

    The reference point which is fixed during resize.

    One of Reference Points.

    Default is constants.kRefPointTopLeft.

  • offsetX (float) –

    Horizontal offset from the given reference point

    Illustrator® Ignored.

  • offsetY (float) –

    Vertical offset from the given reference point

    Illustrator® Ignored.

  • executeLayoutRules (bool) –

    Execute layout rules “After geometry changes” while executing the command?

    • TrueYes, execute rules “after geometry” changes.

      This may cause problems and/or side effects like infinite recursion!

    • False : No, suppress rules.

Return type:

None

Raises:
Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::resize

CGroup.getRefPoint(refPoint, pageRelative=True)

Get the coordinates of this pageitem’s reference point

Parameters:
  • refPoint (int) –

    The reference point to get the coordinates for.

    One of Reference Points.

  • pageRelative (bool) –

    InDesign® comet_pdf®

    • True: Get the coordinates as page-relative

    • False: Get the coordinates as spread relative

    Illustrator®

    • True: Get the coordinates as artboard-relative

    • False: Get the coordinates as global

Returns:

Coordinates (x, y)

Return type:

tuple[float, float]

Raises:
Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::refpoint

CGroup.getScale()

Get the item’s current scale factors.

Returns:

The scale factors (vertical, horizontal) where 1.0 = 100%.

Return type:

tuple[float, float]

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::get_scale

CGroup.setScale(x, y, refPoint=0, executeLayoutRules=False)

Scale the item by the given factors.

Parameters:
  • x (float) – Width factor

  • y (float) – Height factor

  • refPoint

    The reference point to scale the frame around

    Depending on the parameter type, the behavior changes as follows:

    int

    Use a defined reference point.

    One of Reference Points.

    tuple (float, float)

    Horizontal and vertical offset from the top left point.

    comet_pdf® Ignored. The left top point is always used.

    Default is constants.kRefPointTopLeft

  • executeLayoutRules (bool) –

    Execute layout rules “After geometry changes” while executing the command?

    • TrueYes, execute rules “after geometry” changes.

      This may cause problems and/or side effects like infinite recursion!

    • False : No, suppress rules.

Return type:

None

Raises:
  • TypeError – When parameter types are invalid

  • ValueError

    • When parameter x or y are <= 0.0

    • When parameter refPoint is of type int and has invalid value

  • CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::scale

CGroup.getRotation()

Get the item’s rotation

Returns:

The rotation in degrees

Return type:

float

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::get_rotate

CGroup.setRotation(angle, refPoint=4, executeLayoutRules=False)

Rotate the item around it’s own reference point.

The rotation angle is absolute.

Parameters:
  • angle (float) – The angle to rotate the item in degrees counter clockwise

  • refPoint (int) –

    The reference point which is fixed during rotation.

    One of Reference Points.

    Default is constants.kRefPointCenter.

  • executeLayoutRules (bool) –

    Execute layout rules “After geometry changes” while executing the command?

    • TrueYes, execute rules “after geometry” changes.

      This may cause problems and/or side effects like infinite recursion!

    • False : No, suppress rules.

Return type:

None

Raises:
Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::rotate

CGroup.getSkew()

Get the current skew angle of the item.

Returns:

The current skew angle

Return type:

float

Available:

InDesign® comet_pdf®

CScript:

frame::get_skew

CGroup.setSkew(angle, refPoint=0, executeLayoutRules=False)

Skew an item horizontally. For a vertical skew, use the negative angle to skew followed by a rotation to the negative angle (use the same reference point for both transformations!).

Parameters:
  • angle (float) – The skew angle

  • refPoint (int | tuple[float, float]) –

    The reference point to scale the item around

    Depending on the parameter type, the behavior changes as follows:

    int

    Use a defined reference point. Value must be one of Reference Points

    tuple [float, float]

    Horizontal and vertical offset from the top left point.

    comet_pdf® Ignored. The left top point is always used.

    Default is constants.kRefPointTopLeft

  • executeLayoutRules (bool) –

    Execute layout rules “After geometry changes” while executing the command?

    • True:

      Yes, execute rules “after geometry” changes. This may cause problems and/or side effects like infinite recursion!

    • False:

      No, suppress rules.

Return type:

None

Raises:
Available:

InDesign® comet_pdf®

CScript:

frame::skew

CGroup.getLocked()

Returns whether the item is locked.

Returns:

Whether the item is locked

Return type:

bool

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::is_locked

CGroup.setLocked(locked=True)

Set the lock state of the item.

Parameters:

locked (bool) – The new lock state

Return type:

None

Raises:
Available:

InDesign® comet_pdf® Illustrator®

CScript:
CGroup.getVisible()

Determine whether the item is visible or hidden.

Returns:

Whether the item is visible

Return type:

bool

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::is_hidden

CGroup.setVisible(visible=True)

Set the visibility state of this item.

Parameters:

visible (bool) – Whether the item should be visible or not

Return type:

None

Raises:

TypeError – When parameter types are invalid

Available:

InDesign® comet_pdf® Illustrator®

CScript:
CGroup.getPrintable()

Get the printability of the item (printing and PDF exports).

Returns:

Whether the item is marked as printable

Return type:

bool

Raises:

CometError – On internal error

Available:

InDesign®

CScript:

frame::get_printable

CGroup.setPrintable(enable)

Set the printability of the item (printing and PDF exports).

Parameters:

enable (bool) – Enable printability?

Return type:

None

Raises:
Available:

InDesign®

CScript:

frame::set_printable

CGroup.getOverprint(what=0)

Get the overprint setting of the item.

Parameters:

what (int) –

Which setting to query

One of Overprint settings

Default is constants.kOverprintBasic

Returns:

Whether overprint is active for the queried setting

Return type:

bool

Raises:
Available:

InDesign®

CScript:

frame::get_overprint

CGroup.setOverprint(enable, what=0)

Set the overprint setting of the item.

Parameters:
Return type:

None

Raises:
Available:

InDesign®

CScript:

frame::set_overprint

CGroup.setStroke(options)

Set the stroke of this item.

Parameters:

options (dict[str, bool | int | float | str | CColor | CSwatch | tuple[int, int, int], tuple[float, float, float, float], tuple[float, int, int]]) –

The stroke options.

Keys must be str.

Value types depend on the provided keys.

The following options are available:

Stroke options

Key

Type

Description

’color’

The color to set.

The parameter type can be:

’width’

float

The stroke width in pt.

’tint’

float

The stroke tint in % in range(0.0-100.0).

’overprint’

bool

Whether to overprint the background.

’type’

int

The stroke type.

One of Stroke types

’gapColor’

str

A swatch name to use for the gap color.

’gapTint’

float

The stroke gap tint in % in range(0.0-100.0).

’gapOverprint’

bool

Whether to overprint the gap background.

’alignment’

int

Alignment of the stroke.

One of the following values:

  • 0: Centered

  • 1: Interior

  • 2: Outside

’miter’

float

Line miter in range(1.0-500.0).

Return type:

None

Raises:
  • TypeError

    • When parameter types are invalid.

    • When parameter options has non-str key.

    • When parameter options has value type which does not match the expected type.

  • ValueError

    • When parameter options[‘color’] has color values which are out of range.

    • When parameter options[‘width’] is < 0.0.

    • When parameter options[‘tint’] is out of range.

    • When parameter options[‘lineStyle’] is out of range.

    • When parameter options[‘gapTint’] is out of range.

    • When parameter options[‘alignment’] is out of range.

    • When parameter options[‘miter’] is out of range.

  • KeyError – When parameter options contains invalid key.

  • CometError – On internal error

Available:

InDesign® comet_pdf®

CScript:
CGroup.getObjectStyle(translate=False)

Get the full path to this item’s object style.

When the style if part of a hierarchy, the name is delimited by ‘:’

Parameters:

translate (bool) –

Translate default names?

  • True: Default names are returned in the host software locale.

  • False: In this case, the names of the default styles are always returned in English.

Returns:

Full path to the object style

Return type:

str

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf®

CScript:

frame::get_objectstyle

CGroup.setObjectStyle(stylePath, removeOverrides=False)

Set this item’s object style.

Parameters:
  • stylePath (str) –

    Full object style path.

    When the style if part of a hierarchy, the name is delimited by ‘:’

    • ’’: Use default object style for this item type

  • removeOverrides (bool) – Remove local overrides?

Return type:

None

Raises:
Available:

InDesign® comet_pdf®

CScript:

frame::set_objectstyle

CGroup.getZOrder(intersecting=False)

Determine the Z order of this page item. If the page item is a group, this group is treated as one object, for all other groupings the page item are treated as individual objects.

Parameters:

intersecting (bool) –

  • False: Determine Z-order within the spread.

  • True: Use only the page items that overlap the specified page item to determine the Z-order.

The page item that is furthest forward has Z-order 1 - but it does not have to be the frontmost page item of the spread.

Likewise, of course, the page item with the largest Z-value does not need to be the bottom page item of the spread.

Illustrator® Ignored

Returns:

The 1-based Z order of the page item

Return type:

int

Raises:
Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::get_z_order

CGroup.moveForward()

Move the page item forward one step in the Z order.

Return type:

None

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::bring_forward

CGroup.moveBackward()

Move the page item backward one step in the Z order.

Return type:

None

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::send_backward

CGroup.moveToFront()

Move the page item to the most forward position undernearth its parent.

Return type:

None

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::bring_to_front

CGroup.moveToBack()

Move the page item to the most backward position undernearth its parent.

Return type:

None

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::send_to_back

CGroup.isInFront()

Determine whether the page item is the topmost item of its page.

Returns:

Whether the page item is at the top.

Return type:

bool

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::is_in_front

CGroup.isInBack()

Determine whether the page item is the bottommost item of its page.

Returns:

Whether the page item is at the bottom.

Return type:

bool

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::is_at_back

CGroup.getOpacity(type=0)

Get the opacity of this item.

Parameters:

type (int) –

Which opacity type to get.

  • 0 : Object

  • 1 : Stroke

  • 2 : Fill

  • 3 : Content

Returns:

The opacity in range[0.0, 100.0]

Return type:

float

Raises:
Available:

InDesign® comet_pdf®

CScript:

frame::get_opacity

CGroup.getFillColor()

Get the primary fill color of this item.

Returns:

The color and swatch if any is applied, else None.

Return type:

tuple[CColor, CSwatch | None]

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::get_color

CGroup.setFillColor(color)

Set the primary fill color of this item.

Parameters:

color (CColor | CSwatch | str | tuple[int, int, int] | tuple[float, float, float, float]) –

The color data to apply.

The parameter type can be:

Return type:

None

Raises:
  • TypeError – When parameter types are invalid

  • ValueError – When parameter color is invalid or any provided values inside are invalid

  • CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::color

CGroup.getScriptTag(key)

Get the value of a single script tag. Returns None when the key does not exist.

Parameters:

key (str) – The script tag key to get the value for

Returns:

The found value or None if the key does not exist.

InDesign® comet_pdf® Only values of type str are supported. Other data types get converted to string representations of their values.

Return type:

str | int | float | bool | None

Raises:
Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::get_script_tag

CGroup.getScriptTags()

Fetches all script tags of the item. Data types may vary depending on the tag type.

Returns:

A list of all script tags as key/values.

InDesign® comet_pdf® Only values of type str are supported. Other data types get converted to string representations of their values.

Return type:

list[tuple[str, str | int | float | bool]]

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:
CGroup.setScriptTag(key, value)

Set the value of a script tag. The value is overwritten if it already exists.

Parameters:
  • key (str) – The script tag key to set

  • value (str | int | float | bool) –

    The value to set.

    InDesign® comet_pdf® Only values of type str are supported. Other data types get converted to string representations of their values.

Return type:

None

Raises:
Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::set_script_tag

CGroup.removeScriptTags(keys)

Remove script tags.

Parameters:

keys (list[str]) – The script tag keys to remove

Raises:
Return type:

None

Available:

InDesign® comet_pdf® Illustrator®

CGroup.getWrap()

Get the contour type and the contour spacing.

Returns:

A tuple of: (mode, left contour width, top contour height, right contour width, bottom contour width)

Where mode is one of Wrap types

Return type:

tuple[int, float, float, float, float]

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf®

CScript:

frame::getwrap

CGroup.setWrap(mode=-1, left=None, top=None, right=None, bottom=None)

Set the contour type and the contour spacing.

Parameters:
  • mode (int) –

    The contour type.

    One of Wrap types

  • left

    The parameter type can be:

    • float: Left contour width. In case of using a contour, the value is set but unused.

    • None: Leave unchanged.

  • top

    The parameter type can be:

    • float: Upper contour height. In case of using a contour, the value is used as the distance around the shape.

    • None: Leave unchanged.

  • right

    The parameter type can be:

    • float: Right contour width. In case of using a contour, the value is set but unused.

    • None: Leave unchanged.

  • bottom

    The parameter type can be:

    • float: Bottom contour height. In case of using a contour, the value is set but unused.

    • None: Leave unchanged.

Return type:

None

Raises:
Available:

InDesign® comet_pdf®

CScript:

frame::wrap

CGroup.getWrapIgnore()

Determine whether this apply should apply the text outline guidance of other items.

Return bool:
  • True: Ignore contour guidance

  • False: Activate contour guidance

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf®

CScript:

frame::getwrap_ignore

CGroup.setWrapIgnore(state=True)

Set whether or not this item should apply the text outline guidance of other items.

It does not influence whether the item itself sets an outline guide.

Parameters:

state (bool) –

  • True: Ignore contour guidance

  • False: Activate contour guidance

Return type:

None

Raises:

TypeError – When parameter types are invalid

Available:

InDesign® comet_pdf®

CScript:

frame::wrap_ignore

CGroup.overrideMasteritem(page)

Localize a given master page item for a document page.

Single-page spreads on double-page spreads and double-page spreads on single-page spreads are supported.

But in order to avoid horizontal shifts of the overridden items, spreads with more than two pages must use master pages with at least the same number of pages. Otherwise you must correct the horizontal shift in your scripts.

Parameters:

page (CPage | int) –

The target page which has the master page of the master item applied.

The parameter can type can be:

Returns:

The newly overridden and localized page item.

Return type:

CPageItem

Raises:

TypeError – When parameter types are invalid

Available:

InDesign® comet_pdf®

CScript:

frame::override_masteritem

CGroup.isMasteritemOverriden(page)

Is this master page item localized on a given page?

Please note that, unlike isOverridenMasteritem(), this method requires a page specification. Overrides are always done on a per-page basis.

Parameters:

page (CPage | int) –

The target page to query for an overridden master item.

The parameter can type can be:

Returns:

The overridden item or None when an overridden item does not exist.

Return type:

CPageItem | None

Raises:

TypeError – When parameter types are invalid

Available:

InDesign® comet_pdf®

CScript:

frame::is_masteritem_overriden

CGroup.isOverridenMasteritem()

Is this item an overridden master page item?

In contrast to isMasteritemOverriden(), the function does not require a page specification, as the page number can be determined implicitly from the given item reference.

Returns:

The master page item this item has been overridden from or None when no master item exists.

Return type:

CPageItem | None

Available:

InDesign® comet_pdf®

CScript:

frame::is_overriden_masteritem

CGroup.removeMasteritemOverride()

Remove all local overrides of this page item.

The function checks whether the page item is an overridden master page item at all and, if necessary, restores the original state of the master page item.

The item is then no longer localized.

If this page item is a sub-element of a group, the entire group is automatically processed.

Return type:

None

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf®

CScript:

frame::remove_masteritem_override

CGroup.getAlternativeText()

Determine the settings for the alternative text of this item.

This setting can be made manually in InDesign® using the dialog Object -> Object export options… dialog in the Alternative text category.

Return A tuple of the following values:
  • Determined source of the alternative text.

  • User-defined alternative text. It is irrelevant whether the item actually uses this text (type 0) or not.

  • Namespace prefix in the XMP header. The value is defined automatically for XMP-based texts and is only of technical interest.

  • Input path in the XMP header. The value is defined automatically for XMP-based texts and is only of technical interest.

Return type:

tuple[int, str, str, str]

Raises:

CometError – On internal error

Available:

InDesign®

CScript:

frame::get_alt

CGroup.setAlternativeText(source, text='')

Define an alternative text as a frame or image description.

This setting can be made manually in InDesign® using the dialog Object -> Object export options… dialog in the Alternative text category.

Parameters:
  • source (int) –

    Source for the alternative text text.

    • 0: User-defined. The text is specified in the text parameter.


    The texts for the following information are determined from the IPTC core of the XMP structure of the image. You can define this information e.g. using the Adobe Bridge metadata panel.

    • 1: From XMP:Title

    • 2: From XMP:Description

    • 3: From XMP:Caption

    • 6: From XMP:Alternative text (accessibility)

    • 7: From XMP:Extended description (accessibility)


    These values are set but not further supported by priint:comet.

    • 4: From other XMP

    • 5: From structure

  • text (str) – User-defined description text. The specification is only used for source 0 (user-defined).

Return type:

None

Raises:

CometError – On internal error

Available:

InDesign®

CScript:

frame::set_alt

CGroup.getPDFAccessibility()

Determine the settings for accessible description text of this item.

This setting can be made manually in InDesign® using the dialog Object -> Object export options… in the PDF with tags category.

Returns:

A tuple of the following values:

  • Type of source of the accessible description text

  • Determined source of the accessible description text

  • User-defined accessible description text. It is irrelevant whether the item actually uses this text (type 0) or not.

  • Variable for the namespace prefix in the XMP header. The value is defined automatically for XMP-based texts and is only of technical interest.

  • Property path in the XMP header. The value is defined automatically for XMP-based texts and is only of technical interest.

Return type:

tuple[int, int, str, str, str]

Raises:

CometError – On internal error

Available:

InDesign®

CScript:

frame::get_pdf_accessibility

CGroup.setPDFAccessibility(type, source, text='')

Define a text for the accessible description of the content of a frame.

This setting can be made manually in InDesign® using the dialog Object -> Object export options… dialog in the PDF with tags category.

Parameters:
  • type (int) –

    Apply tag:

    • 0: From structure

    • 1: Extra-textual element

    • 2: Based on object

  • source (int) –

    Source for actual text

    • 0: User-defined. The text is specified in the text parameter.


    The texts for the following information are determined from the IPTC core of the XMP structure of the image. You can define this information e.g. using the Adobe Bridge metadata panel.

    • 1: From XMP:Title

    • 2: From XMP:Description

    • 3: From XMP:Caption

    • 6: From XMP:Alternative text (accessibility)

    • 7: From XMP:Extended description (accessibility)


    These values are set but not further supported by priint:comet.

    • 4: From other XMP

    • 5: From structure

  • text (str) – User-defined description text. The specification is only used for source 0 (user-defined).

Return type:

None

Raises:
  • TypeError – When parameter types are invalid

  • ValueError

    • When parameter type is out of range

    • When parameter source is out of range

  • CometError – On internal error

Available:

InDesign®

CScript:

frame::set_pdf_accessibility

CGroup.remove()

Remove this group and all it’s members from the document.

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

Return type:

None

Raises:

CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®

CScript:

frame::ungroup

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:

InDesign® comet_pdf® Illustrator®

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:

InDesign® comet_pdf® Illustrator®

CScript:

frame::group_content

CGroup.addMembers(objects)

Add new members to this group.

InDesign® 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:

InDesign® comet_pdf® Illustrator®

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.

InDesign® 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:

InDesign® comet_pdf® Illustrator®

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:

InDesign® comet_pdf® Illustrator®

CScript:

frame::ungroup

Special methods

CGroup.__repr__()

String representation.

Returns:

InDesign® comet_pdf®

<CGroup> UID: ID | Member count: Member count

Members: Comma separated member UIDs

Illustrator®

<CGroup> Member count: Member count

Example
<CGroup> UID: 391 | Member count: 2
Members: 368, 364

Return type:

str