comet.CFrame¶
- class comet.CFrame¶
- Inherits:
InDesign® comet_pdf® CFrame is a reference to a document page item (e.g. a frame)
Illustrator® CFrame is a reference to a document art object (e.g. a text frame)
Inherited methods¶
- CFrame.getUID()¶
Get the UID of this item as an int.
- Returns:
The UID of this item
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getType()¶
Determine the type of the item.
- Returns:
The type of the item.
One of Pageitem types
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.getDocument()¶
Get the document this item belongs to.
- Returns:
The document
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CFrame.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:
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.getLayer()¶
Get the layer this item is on.
- Returns:
The item’s layer
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.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:
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 raiseCometError
in this case.
ignoreLayerLocks (bool) –
Allow moving from and 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:
- CFrame.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:
- CFrame.getGroup()¶
Get the group this item 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:
- CFrame.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:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter nameType has invalid value.
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.setName(name)¶
Set the name of this item.
- CFrame.getBBox(spreadRelative=False)¶
Get the bounding box of this item.
- CFrame.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?
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:
TypeError – When parameter types are invalid
ValueError – When parameter page has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- See also:
- CScript:
- CFrame.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:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.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?
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.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®
- Returns:
Coordinates (x, y)
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameters refPoint has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.getScale()¶
Get the item’s current scale factors.
- Returns:
The scale factors (vertical, horizontal) where 1.0 = 100%.
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.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:
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?
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
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:
- CFrame.getRotation()¶
Get the item’s rotation
- Returns:
The rotation in degrees
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.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?
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter refPoint has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.getSkew()¶
Get the current skew angle of the item.
- Returns:
The current skew angle
- Return type:
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.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:
Use a defined reference point. Value must be one of Reference Points
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?
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter refPoint is of type
int
and has invalid valueCometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getLocked()¶
Returns whether the item is locked.
- Returns:
Whether the item is locked
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.setLocked(locked=True)¶
Set the lock state of the item.
- Parameters:
locked (bool) – The new lock state
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.getVisible()¶
Determine whether the item is visible or hidden.
- Returns:
Whether the item is visible
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.setVisible(visible=True)¶
Set the visibility state of this item.
- CFrame.getPrintable()¶
Get the printability of the item (printing and PDF exports).
- Returns:
Whether the item is marked as printable
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign®
- CScript:
- CFrame.setPrintable(enable)¶
Set the printability of the item (printing and PDF exports).
- Parameters:
enable (bool) – Enable printability?
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign®
- CScript:
- CFrame.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:
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign®
- CScript:
- CFrame.setOverprint(enable, what=0)¶
Set the overprint setting of the item.
- Parameters:
enable (bool) – Enable the specified setting?
what (int) –
Which setting to change
One of Overprint settings
Default is
constants.kOverprintBasic
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign®
- CScript:
- CFrame.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:
- Return type:
None
- Raises:
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.
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:
- CFrame.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?
- Returns:
Full path to the object style
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.setObjectStyle(stylePath, removeOverrides=False)¶
Set this item’s object style.
- Parameters:
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.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:
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.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:
- CFrame.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:
- CFrame.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:
- CFrame.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:
- CFrame.isInFront()¶
Determine whether the page item is the topmost item of its page.
- Returns:
Whether the page item is at the top.
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.isInBack()¶
Determine whether the page item is the bottommost item of its page.
- Returns:
Whether the page item is at the bottom.
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.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:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter type has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getFillColor()¶
Get the primary fill color of this item.
- Returns:
The color and swatch if any is applied, else
None
.- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.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:
- CFrame.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:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter key is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.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:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.setScriptTag(key, value)¶
Set the value of a script tag. The value is overwritten if it already exists.
- Parameters:
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameters key is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.removeScriptTags(keys)¶
Remove script tags.
- Parameters:
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Return type:
None
- Available:
InDesign® comet_pdf® Illustrator®
- CFrame.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:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.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:
top –
The parameter type can be:
right –
The parameter type can be:
bottom –
The parameter type can be:
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter mode has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getWrapIgnore()¶
Determine whether this apply should apply the text outline guidance of other items.
- Return bool:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.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.
- CFrame.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:
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:
- Raises:
TypeError – When parameter types are invalid
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.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.
- CFrame.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.
- CFrame.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:
- CFrame.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:
- Raises:
CometError – On internal error
- Available:
InDesign®
- CScript:
- CFrame.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:
- CFrame.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:
- Raises:
CometError – On internal error
- Available:
InDesign®
- CScript:
- CFrame.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
When parameter type is out of range
When parameter source is out of range
CometError – On internal error
- Available:
InDesign®
- CScript:
- CFrame.remove()¶
Deletes this item and all it’s children from it’s document.
All subsequent calls to this item’s or the item’s children functions will fail.
- Return type:
None
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
Methods¶
- CFrame.isInline()¶
Is this frame an inline frame?
- Returns:
Whether this frame is an inline frame.
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.isNote()¶
Is this frame a comet note?
- Returns:
Whether this frame is a comet note.
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.getColumnCount()¶
Get the number of text columns of the frame
- Returns:
The column count
- Return type:
- Raises:
TypeError – When this frame is not a text frame
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.setColumnCount(count)¶
Set the column count of the frame
- Parameters:
count (int) – The new count
- Raises:
When parameter types are invalid
When this frame is not a text frame
ValueError – When parameter count is < 1
CometError – On internal error
- Return type:
None
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getColumnGutter()¶
Get the gutter of text columns of the frame
- Returns:
The column gutter
- Return type:
- Raises:
TypeError – When this frame is not a text frame
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.setColumnGutter(gutter)¶
Set the column gutter of the frame
- Parameters:
gutter (float) –
The new gutter value.
< 0.0: Reset to default value
- Return type:
None
- Raises:
When parameter types are invalid
When this frame is not a text frame
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.hasOverset(fullChain=True)¶
Are text parts of the text model or frame non-visible? If the text has this so-called overset, a small red plus is shown at the selected frame. The function can only ascertain the overset of textframes or texts.
- Parameters:
fullChain (bool) –
Check the complete text frame chain?
- Returns:
Whether the frame has overset
- Return type:
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.getTextModel()¶
Fetch the text model interface of this frame if it is a text frame.
- Returns:
The frame’s text model
- Return type:
- Raises:
TypeError – When this frame is not a text frame
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CFrame.getText(position=0, length=-1, format=0)¶
Get text content of a Text frame.
The export can be carried out as pure text (
constants.kExportPlain
) or as text with formatting.InDesign®
Formattings are written as InDesign® TaggedText. The format of the TaggedText is independent from the settings of the export dialog and is always done with the following settings :
Coding ASCII, Unicode characters are written in the form <0x2202> Platform Windows,rn (13 10) is used as line delimiter of the (internal) formatting Style unabbreviated, i.e. ParaStyle instead of pstyle, …
If the text contains InDesign® variables, the internal code used in the document (and not the current value) is exported on pure text formats like
constants.kExportPlain
. Use the ~Plus~-Formats to replace InDesign® variables by their current values.- Parameters:
start (int) – Start position
length (int) –
Number of characters to fetch.
Default is
constants.kEnd
== until the endformat (int) –
The export format.
See Text formats.
comet_pdf® Illustrator® Only supported format is
constants.kExportPlain
- Returns:
The frame’s text
- Return type:
- Raises:
When parameter types are invalid
When this frame is not a text frame
ValueError – When parameter start, length or format has invalid Value
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
See also
- CFrame.setText(text, start=0, length=-1, autoLoad=True, flags=0)¶
Replace text in the frame. Inserting formatted text like TaggedText or HTML is also possible.
- Parameters:
text (str) – The text to insert
start (int) – Insert position in the text
length (int) –
Number of characters to replace.
Default is
constants.kEnd
== until the endautoLoad (bool) –
When inserting TaggedText, should placeholders be loaded?
Illustrator® Ignored
flags (int) –
Instructions for preparing TaggedText.
0 : Off
2 : Fix parastyles of all cells
4 : Fix parastyles of complete text
8 : Check tables
16 : Replace <in> tags by <w2inline> tags
32 : Repair hyperlinks
Please note:For normal text, the parameter has no meaning.As of v4.1.6 R25777 the w2inline replacement always is done automatically. Since w2inline is a character attribute and can only be evaluated if a paragraph style is defined, the paragraphs will also be corrected in all non-empty table cells. Changes to your TaggedText are not required for this.InDesign® If the option Plug-Ins -> Comet -> Read PlaceHolders from TaggedText is disabled, the flags 2, 4 and 16 do not have any meaning and are ignored.
comet_pdf® Flags 2 and 4 have no meaning, missing or empty paragraph styles are always calculated and used here.
Illustrator® Ignored
- Raises:
When parameter types are invalid
When this frame is not a text frame
CometError – On internal error
- Returns:
None
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
See also
- CFrame.replace(content, position=0, length=-1, autoLoad=True, flags=0)¶
Replace text in a frame.
InDesign® comet_pdf® The text may be TaggedText.
InDesign® comet_pdf® Illustrator® The text may be prefixed HTML text.
- Parameters:
content (str) – The text to insert.
position (int) – The position to insert the text.
length (int) –
How many characters should be overwritten at max?
Default is
constants.kEnd
== overwrite until the end.autoLoad (bool) –
Should text placeholders in TaggedText be loaded?
Illustrator® Ignored
flags (int) –
Instructions for preparing TaggedText. For normal text, the parameter has no effect.
0 : Off
1 : Fix parastyles of non-empty cells
2 : Fix parastyles of all cells
4 : Fix parastyles of complete text
8 : Check tables
16 : Replace <in> tags by <w2inline> tags
Illustrator® Ignored
comet_pdf® Values 1, 2 and 4 are ignored. Missing or empty paragraph styles are always calculated and used here.
- Returns:
None
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameters length or flags are out of range or invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.fit(refPoint=0, constantWidth=False)¶
Fit a frame to its content
- Parameters:
refPoint (int) –
The reference point which is fixed during resizing.
One of Reference Points.
constantWidth (bool) – When the text content is on a single line, should we keep the width?
- Returns:
Result sizes as (new width, new height)
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter refPoint has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.fitImage(method, data=5, size=0.0, maxScale=1.0)¶
Fit an image to its frame.
- Parameters:
method (int) –
Fitting method. One of:
0: Fill frame proportionally: Scale image proportionally to completely fill the frame
1: Fit content proportionally: Scale image to become completely visible
2: Fit content to frame:Scale image in both directions to completely fill the frame
3: Fit frame to content: Fit the frame to match the image.
4: Center content in frame
5: Comet position
data (int) –
Additional information about the placement of the image.
Methods 0, 1, 2 and 4:-1: Use InDesign® built-in method only
Otherwise: Use priint:comet method
Method 5:Image position. If the parameter is omitted, then - if the image has already been placed by the Comet - the last Comet placement for this image is restored.
size (float) – Image placement size of bounding box for image.
maxScale (float) – Maximum image scaling factor
- Returns:
None
- Raises:
TypeError – When parameter types are invalid
When parameter method has invalid value.
When parameter data has invalid value.
When parameter size has invalid value.
When parameter maxScale has invalid value.
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getChainFrames()¶
Get all frames in the chain of this frame.
The result is ordered in the order the frames are linked.
- Returns:
A list of all chained frames including this one.
- Return type:
- Raises:
TypeError – When this frame is not a text frame
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getImage()¶
Get the full path to the image in this frame
- Returns:
The image path
- Return type:
- Raises:
TypeError – When this frame is not an image frame
CometError – On internal error.
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.setImage(path, alignment=0, boundingBox=0.0, options={})¶
InDesign® comet_pdf® Insert an image into this frame
Illustrator® Replace the image
- Parameters:
path (str) – The full path to the image file
alignment (int) –
InDesign® comet_pdf® The alignment of the image in the frame.
Illustrator® Align this reference point with the same reference point of the old image.
One of Image placement.
For more information see here.
boundingBox (float) –
The new size of the image.
0.0 : Fit image (proportionally) into the frame. If the image is smaller than the frame it is left unchanged.
> 0.0 : Fit image proportionally into a square frame of this size. If the image is smaller, it is not changed.
< 0.0 : Fit image proportionally into a square frame of this size. If the image is smaller, it is enlarged accordingly.
Illustrator® Ignored
options (dict[str, str | int]) –
Additional import options which depend on the input file type.
Keys must be
str
. Value types depend on the provided keys.The following options are available:
PDF
’kPageIndex’
Value type:
int
Default: 0
The page index to place from the PDF file.
-1: Use last page.
Greater than page count - 1: Use first page.
Else: Place the page with this index.
’kPageNumber’
Value type:
int
Default: 1
The page number to place from the PDF file. This behaves the same as ‘kPageIndex’ but uses 1-based numbers.
This option is mutually exclusive with ‘kPageIndex’.
’kCropBox’
The cropping behavior to apply.
The following values are available:
’kDefault’, -1 or 1: Use the application default.
’kContent’, or 0: Crop to content.
’kArt’, or 2: Crop to art.
’kCrop’, or 3: Crop to page.
’kTrim’, or 4: Crop to trim.
’kBleed’, or 5: Crop to bleed.
’kMedia’, or 6: Crop to media.
’kContentAllLayers’, or 7: Crop to content (all layers).
Illustrator® Not supported.
’kLayers’
List of layer names.
All specified layers of the PDF file will be made visible, all others invisible.
If the list is empty, the layer visibility settings of the PDF file will be used.
Attention: It is not sufficient to set the layer visibility in the PDF with the layer eyes only, you have to use the layer options for that!
Illustrator® Not supported.
Pixel Images
’kPathIndex’
Value type:
int
Default: -1
0-based index of clipping path
-3: If there is already a clip path, this path is reset.
-2: Ignore.
-1: Use the setting of kPathName.
>= 0: 0-based index of clipping path. Ignored by comet_pdf!
’kPathName’
Value type:
str
Name of clipping path. The option is ignored by InDesign® if the path is defined by kPathIndex already.
’kClipToFrame’
Use the the clipping path as the frames path?
-3: If there is already a clip path, this path is reset.
-2: Ignore.
The following values are available:
’kPathFlags’
Value type:
int
Default: 0
How to clip the image? Positive values can be added.
-1: Ignore value.
0: Reset option.
1: Invert the resulting path by combining with a path equal to the bounds of the image.
4: For edge detection, do we remove the holes or leave them in.
8: Crop the frame to the image.
comet_pdf® Ignored.
’kClipTolerance’
Value type:
double
Default: 0.0
A tolerance value in the range of 0.0 to 10.0 specifying how close to the original path we must be if we smooth the path. 0.0 indicates a perfect match. Smoothing may simplify the path, reducing the number of points.
comet_pdf® Ignored.
’kClipMinPathSize’
Value type:
double
Default: 0.0
A tolerance value in the range of 0.0 to 10.0 specifying how close to the original path we must be if we smooth the path. 0.0 indicates a perfect match. Smoothing may simplify the path, reducing the number of points.
comet_pdf® Ignored.
’kClipInset’
Value type:
double
Default: 0.0
How far to inset the path. Given in points.
comet_pdf® Ignored.
’kAlphaIndex’
Value type:
int
Default: -4
0-based index of channel
-6: Reset option value to default (-4).
-5: Ignore (leave value of option untouched).
-4: Use the setting of kPathName.
-3: Default Clip index (0 InDesign, -2 comet_pdf).
-2: Ignore any Alpha channel.
-1: Use kAlphaName.
>= 0: 0-based index of Alpha channel. Ignored by comet_pdf!
’kAlphaName’
Value type:
str
Name of Alpha channel. The value ignored by InDesign® if the channel is defined by its index already.
’kAlphaTreshold’
Value type:
int
Default: 255
Treshold for alpha channel.
0-255: The alpha channel is applied to the image after the image import. The result is the same like using menu Object -> Clipping path -> Options and indeed it is a very bad result. Ignored by comet_pdf.
>255: Recommended! Apply the alpha channel directly while importing the image.
Web Images (URLs)
’kURLSuppressCheckExisting’
This option is mutually exclusive with ‘kUpdateFlags’.
’kUpdateFlags’
Value type:
int
Default: 0
Flags used when loading URL images. Available from v5.0 onwards.
This option is mutually exclusive with ‘kURLSuppressCheckExisting’.
16: If the local image file already exists, it is used without further checking.
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
When parameter path is empty
When parameter alignment has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.setBarcode(code, type, width=144, height=92, offsetX=10, offsetY=10, options={'options': 'includetext'})¶
Create and insert a barcode.
Since this function depends on third party implementations, it is considered ‘nice to have’ and not part of support coverage.
A barcode in the required format is generated from the specified text and embedded in the document frame as a postscript image without any further linking.
No additional image files are created.
InDesign®
Directly embedded postscript images are changed during IDML export/import by InDesign®:
Embedded postscript images are automatically converted to pixel images during import. The converted image is thenembedded in a new frame. This frame is then created as a subframe of the original frame.
The pixel images may have a different size than the original postscript images.
The pixel images (naturally) have a fixed resolution. (But we do not know this).
If your documents are to remain IDML-stable, the images must be created either as normal file links or as embedded images of files. The function supports both methods.
See the optional parameters filetype and filepath.
- Parameters:
code (str) –
Text to be encoded.
Braces and backslashes in the text are automatically encoded.
type (str) –
Barcode type. The following types are supported:
width (int) –
Size of the generated image in dots.
The size does not affect the size of the barcode. It influences the “page size” on which the barcode is drawn.
The barcode is always drawn at the bottom left (typical for postscript).
The larger the values you use for width and height, the larger the white space at the top and right.
You may have to try a little until you have found the optimum size for your barcodes.
height (int) – Height in dots. See parameter width.
offsetX (int) –
The distance of the barcode from the bottom left corner of the image.
The information always describes the position of the actual code.
Additional text information can appear below and to the left of this position.
Here, too, you may have to experiment a little until you have found the correct information
offsetY (int) – The distance of the barcode from the bottom left corner of the image. See parameter offsetX.
options (dict[str, bool | float | str]) –
Additional options.
Here you will find a description of all supported values. Further code-specific values can be found in the descriptions of the respective codes.
The default value includes the option ‘includetext’ with a value of
True
. If no texts are to be added to the code, you can specify the key ‘suppresstext’ with a value ofTrue
in addition to the information described above.The following options are common for all barcode types:
- Return type:
None
- Raises:
When parameter types are invalid
When parameter options contains invalid value types
When parameter type is empty or has invalid value
When parameters width or height are <= 0
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.getImageSize(boundsKind=0)¶
Ascertain the absolute size of the image in this frame.
- Parameters:
boundsKind (int) –
Which type of size to fetch.
0: Bounding box
1: Image frame size
- Returns:
Size as (width, height)
- Return type:
- Raises:
TypeError – When this frame is not an image frame
ValueError – When parameter boundsKind has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.setImageSize(width, height, refPoint=0)¶
Set the absolute size of the image in this frame.
- Parameters:
width (float) – New image width.
height (float) – New image height.
refPoint (int) –
The reference point which is fixed during resize.
One of Reference Points.
Default is
constants.kRefPointTopLeft
.
- Return type:
None
- Raises:
TypeError – When this frame is not an image frame
ValueError – When parameter refPoint has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getImagePosition(boundsKind=0)¶
Ascertain the position of the image inside this frame. The result values are relative to the top left corner of this frame.
- Parameters:
boundsKind (int) –
Fetch position relative to these bounds.
0: Outer stroke path
1: Path bounds (“blue” frame)
- Returns:
Position as (x, y)
- Return type:
- Raises:
When parameter types are invalid
When this frame is not an image frame
ValueError – When parameter boundsKind has invalid value
CometError – On internal error.
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.setImagePosition(x, y)¶
Set the position of the image in this frame.
- Parameters:
- Return type:
None
- Raises:
When parameter types are invalid
When this frame is not an image frame
CometError – On internal error.
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getImageScale()¶
Ascertain the relative size of the image in this frame to its original size.
Return values are factors where 1.0 = 100%
- Returns:
Size as (scaling factor x, scaling factor y)
- Return type:
- Raises:
TypeError – When this frame is not an image frame
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.setImageScale(width, height, refPoint=0, frameRelativeRefPoint=False)¶
Set the size of the image in this frame relative to its original size.
- Parameters:
width (float) – New image width factor
height (float) – New image height factor
refPoint (int) –
The reference point which is fixed during resize.
One of Reference Points.
Default is
constants.kRefPointTopLeft
frameRelativeRefPoint (bool) –
Should the graphics frame be used as the basis for the reference point instead of the image itself?
- Return type:
None
- Raises:
TypeError – When this frame is not an image frame
ValueError – When parameter refPoint has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getImageRotation()¶
Ascertain the rotation of the image in this frame.
- Returns:
The rotation angle in degrees
- Return type:
- Raises:
TypeError – When this frame is not an image frame
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.setImageRotation(angle, x, y)¶
Rotate the image in this frame.
- Parameters:
- Return type:
None
- Raises:
When parameter types are invalid
When this frame is not an image frame
CometError – On internal error.
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getImageSkew()¶
Get the current skew angle of the image in this frame.
- Returns:
The current skew angle of the image
- Return type:
- Raises:
When parameter types are invalid
When this frame is not an image frame
CometError – On internal error.
- CFrame.setImageSkew(angle, x, y)¶
Skew the image of a graphic frame.
- Parameters:
- Return type:
None
- Raises:
When parameter types are invalid
When this frame is not an image frame
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getTableCount(start=0, length=-1)¶
Counts tables in the frame.
- Parameters:
start (int) – The start index
length (int) –
The length to search inside the text.
Default is
constants.kEnd
= Search until the end
- Returns:
The table count
- Return type:
- Raises:
When the frame is not a text frame
When parameters start or index have wrong type
ValueError – When parameters start or index are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getNthTable(index=0, start=0, length=-1)¶
Get a table from the frame. This queries the entire frame chain if the frame is linked.
- Parameters:
index (int) – The table index to get
start (int) – Search from a specific start position
length (int) –
The length to search inside the text.
Default is
constants.kEnd
= Search until the end
- Returns:
The found table
- Return type:
- Raises:
When the frame is not a text frame
When parameters start or index have wrong type
ValueError – When parameters start or index are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getBuiltElements()¶
Get all elements built by an repeating element placeholder. This function only yields valid results when this frame has a repeating element placeholder and has been built at least once.
- Returns:
A list of built elements.
- Return type:
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getCometGroup(searchHierarchy=True)¶
Get the comet group ID of this frame.
- Parameters:
searchHierarchy (bool) –
Search document hierarchy if the frame has no group ID?
Illustrator® Ignored
- Returns:
The comet group or
None
if the frame does not belong to a group- Return type:
CCometGroup | None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.getCometGroupID(searchHierarchy=True)¶
Get the comet group ID of this frame.
- Parameters:
searchHierarchy (bool) –
Search document hierarchy if the frame has no group ID?
Illustrator® Ignored
- Returns:
The comet group ID or 0 if the frame does not belong to a group
- Return type:
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.setCometGroupID(ID)¶
Add a frame to a Comet group. If the frame is a parent frame of a comet group, the entire group is added as a subgroup.
- Parameters:
ID (int) – The new comet group ID
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter ID is <= 0
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.removeFromCometGroup(ID=-1)¶
Detach a frame from a Comet group. The frame is then no longer assigned to any group, except for frames that are themselves the main frame of a group: this membership is retained.
If the Comet ID is -1, the frame is detached from any membership, otherwise only if it is a member of the specified group.
- Parameters:
ID (int) –
The group ID to remove from.
-1: Remove from any group.
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.link(recordID, start=0, length=-1, autoLoad=False, applyRules=False, changeStaticLinks=False)¶
Link all placeholders and all subframes with the given ID.
- Parameters:
recordID –
The record ID to link the content to.
The parameter type can be:
start (int) – The text start index to begin linking.
length (int) –
The text length to link placeholders for.
Default is
constants.kEnd
== link every placeholder until the text endautoLoad (bool) –
Should all placeholders be loaded after linking?
See also
applyRules (bool) –
Only relevant when *autoLoad* is true.
Apply layout rules “After load” after successful execution?
changeStaticLinks (bool) – Overwrite static product links?
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
When parameter recordID has invalid value
When parameter start has invalid value
When parameter length has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CFrame.load(start=0, length=-1, applyRules=False, placeholderIDs=[], recordIDs=[])¶
Execute the load action for all placeholders of a frame or text including its sub-objects.
- Parameters:
start (int) –
The text start index to begin loading.
Only evaluated for text frames.
length (int) –
The text length to load placeholders for.
Default is
constants.kEnd
== load every placeholder until the text end.Only evaluated for text frames.
applyRules (bool) – Apply layout rules “After load” after successful execution?
List of placeholderIDs to restrict loading to. Entries must be of type int
Empty list: Impose no restrictions
recordIDs (list[CIDType | tuple[int, int, int, str]]) –
List of recordIDs to restrict loading to.
Empty list: Impose no restrictions
The entry types can be:
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
When parameter start has invalid value
When parameter length has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CFrame.store(start=0, length=-1, placeholderIDs=[], recordIDs=[])¶
Execute the store action for all placeholders of a frame or text including its sub-objects.
- Parameters:
start (int) –
The text start index to begin storing.
Only evaluated for text frames.
length (int) –
The text length to store placeholders for.
Default is
constants.kEnd
== store every placeholder until the text end.Only evaluated for text frames.
List of placeholderIDs to restrict storing to. Entries must be of type int
Empty list: Impose no restrictions
recordIDs (list[CIDType | tuple[int, int, int, str]]) –
List of recordIDs to restrict storing to.
Empty list: Impose no restrictions
The entry types can be:
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
When parameter start has invalid value
When parameter length has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CFrame.build()¶
Execute the build action of a frame. This action should normally create the repeating elements for this frame. The placeholder of the frame must be:
RelatedTo kMultiFrame (=6)
CharacterStyleID > 0
- Return type:
None
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CFrame.getSmartItemData(key)¶
Get the frame properties to support products buildings.
- Parameters:
key (int) –
Which property to fetch.
Results are:
0: Frame label (Single character)
1: Sequence number
- 2: Type
0 : Normal
1 : Can continue
2 : Repeat (not supported for now)
3 : Can continue but do not change its height
3: Rule to execute before inserting template
-3 : New right page
-2 : New left page
-1 : New page
4: Use this frame in text flows?
0 : Insert text content
1 : Insert as inline
2 : Do not use
5: Use for builds?
0 : Yes
1 : Do not use
2 : Use but ignore on reorganizations
6: Bit field with additional info
0x00000001 : Load frame place holder
0x00000002 : Load text place holder
7: Area type
0 : Bounding Box
1 : Path (star)
2 : Path with holes (empty star)
3 : ignore (minus)
- Returns:
The stored value. The type depends on the data to fetch:
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter key has invalid value
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.setSmartItemData(key, value)¶
Set the frame properties to support products buildings.
- Parameters:
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter key has invalid value
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getNail(referencePoint)¶
Determine whether this frame has a nail at a specific reference point.
- Parameters:
referencePoint (int) –
The reference point to query.
One of Reference Points.
- Returns:
Nail type, edge nail prefers maximum size change.
Nail type can be:
0 : No nail or error
1 : Nail
2 : Percent nail
3 : Magnet (only if not pinned by a nail at this side)
4 : Percent magnet (only if not pinned by a nail at this side)
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter referencePoint has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.setNail(referencePoint, type, preferMax=False)¶
Set or remove priint:adjust nails.
Please note that due to the experimental nature of this function, it is not convered by support
- Parameters:
referencePoint (int) –
The reference point to change the nail for.
One of Reference Points.
type (int) –
The type of nail to set.
0 : Remove
1 : Normal (green) nail
2 : Relative (red) nail
-1 : Toggle
preferMax (bool) –
Edge type, for edge nails only and ignored if parameter type is -1
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
When parameter referencePoint has invalid value
When parameter type has invalid value
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getIncomingMagnets(side)¶
Get a list of all magnets that point to one side of this frame.
The first entry in the list is the ‘main’ magnet.
If other magnets point to the side, these are alternatives to this magnet.
- Parameters:
side (int) –
The side to get the magnets for.
One of Sides
- Returns:
The incoming (alternative) magnets.
- Return type:
- Raises:
CometError – On internal error
ValueError – When parameter side has invalid value.
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getOutgoingMagnets(side)¶
Get a list of all magnets that point from this frame to another frame at a specific side.
- Parameters:
side (int) –
The side to get the magnets for.
One of Sides
- Returns:
The outgoing magnets.
- Return type:
- Raises:
CometError – On internal error
ValueError – When parameter side has invalid value.
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.setMagnet(fromSide, target, targetSide, type=3, isImage=False, canAlt=False)¶
Set or remove magnet for priint::adjust.
For internal use only!
You can use the function, but please note that the function is not part of the support services.
- Parameters:
fromSide (int) –
The side to start the magnet at.
One of Sides.
target (CFrame) – The target frame for the magnet.
targetSide (int) –
The side at the target frame.
One of Sides.
Must be on the same axis as fromSide.
type (int) –
The type of the magnet.
Valid values are:
3: Normal magnet
4: Relative magnet
isImage (bool) –
canAlt (bool) –
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
When parameter fromSide has invalid value.
When parameter targetSide has invalid value.
When parameter type has invalid value.
When parameters fromSide and targetSide are not on the same axis.
CometError – On internal error
- CScript:
- CFrame.applyMagnets(applyRules=False, applyBuildActions=True)¶
Apply magnets of this frame.
This recursively updates all dependent frames aswell.
- Parameters:
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.removeMagnets(fullClosure=False)¶
Delete all magnets, nails and adapter scripts from this frame.
- Parameters:
fullClosure (bool) –
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.applyLayoutRules(situation, callerData=None, recordID=None)¶
Apply layout rules of this frame.
Rules are not executed if the given rule type is suppressed.
- Parameters:
situation (int) –
The situation to execute the layout rules for.
One of Layout rule situations
callerData (None | tuple[CFrame, str, str, str]) –
Only necessary when sending events.
The parameter type can be:
None
: Ignore
Illustrator® Ignored
recordID (tuple[int, int, int, str] | CIDType) –
For unlinked frames when situation is
constants.kLayoutRuleSituationLoad
you may provide an object ID here.The parameter type can be:
Illustrator® Ignored
- Return type:
None
- Available:
InDesign® comet_pdf® Illustrator®
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter callerData is
tuple
[CFrame
,str
,str
,str
] and key is empty strCometError – On internal error
- CScript:
- CFrame.getPageElement(checkCometGroup=False, checkTopLeft=False, queryNearest=False)¶
Determine the page element in which a frame or the frame’s comet group is located.
The assignment to a page element is determined exclusively by the current XY position of the frame (or the comet group of the frame) and the current page template.
- Parameters:
checkCometGroup (bool) –
checkTopLeft (bool) –
queryNearest (bool) –
Behavior on overlapping elements.
False
: Use the first element found (This is the element with the smallest sequence number.)True
: Use the element whose upper left corner is closest to the upper left corner of the frame/comet group
The parameter is used only if checkTopLeft is
True
- Returns:
1-based page element sequence number, page element name
- Return type:
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript:
- CFrame.getTemplate(getName=False)¶
Determine the template which inserted this frame into the document.
- CFrame.showsTextEnd()¶
Does the frame contain the end of the text?
- Returns:
0 : No (The frame either has an overset or it is linked to another text frame).
1 : Yes, the text ends here.
- 2The frame does not show any text.
This case occurs when text frames are linked and the text does not extend to this frame.
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- Raises:
TypeError – When this frame is not a text frame
CometError – On internal error
- CScript:
- CFrame.duplicate(x=None, y=None, addToCometGroup=False, document=None, page=-1, layer='')¶
Duplicate this frame.
By default the new frame has no comet group. Set addToCometGroup to True to copy the original comet group ID.
- Parameters:
x (None | float) –
The new x coordinate for the duplicated frame.
The parameter can type can be:
y (None | float) –
The new y coordinate for the duplicated frame.
The parameter can type can be:
addToCometGroup (bool) –
Whether to add the duplicate to the same comet group as the original.
If you duplicate into another document, the parameter has no effect!
document (CDocument | None) –
The duplicate may be placed into a different document which can be designated here.
None
: Place into same document as the original frame.
The target page
The parameter can type can be:
The target layer
The parameter can type can be:
-
A layer belonging to the same document as the parameter document (when it is set), or to the same document as the source frame
str
:A layer name.
Empty str: Same as the source frame
When this layer does not exist yet, it is not automatically created. In this case the frame is placed on the default one.
-
- Returns:
The newly duplicated frame
- Return type:
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CFrame.getDocLink()¶
Get the document link of this frame if any exists.
- Returns:
The document link or
None
if none exists.- Return type:
CDocLink | None
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf®
- CScript: