Skip to main content

Layoutrules

These layoutrules are included with the default-project to expand on the standard-layoutrules included with the comet-plugin. They can be found in the contextmenu of the Layoutrules-panel in InDesign. To distingush them from the standard-layoutrules by comet, their categories are prefixed by an underscore "_".

Document​

Set Document Attribute​

Id: 1000​

Sets a document attribute with a custom key and value using the comet-method CDocument.setAttribute.

ParametersExplanationDefault
KeyKey of the document-attribute to set.
ValueCustom Value to set for the atttribute. Use '--frame-uid--' to set the current frame's uid as attribute-value.--frame-uid--

Redefine swatch​

Id: 1001​

Sets a document attribute with a custom key and value using the comet-method CDocument.setAttribute.

ParametersExplanationDefault
Swatch NameEnter the name of the swatch, you want to redefine. If you choose --dynamic--, the swatch that is applied to the current pageitem will be redefined.--dynamic--
Color ValuesCommaseparated color values the selected color model.
CMYK: 4x 0-100
RGB: 3x 0-255
Hex: Hex-string
0,100,0,0
Color ModelOne of the following color models: cmyk, rgb, hexcmyk

Frames​

Delete Frame​

Id: 1100​

Deletes the current frame from the document.

warning

All subsequent calls to this item or the item’s children functions will fail.

Delete frame if no value​

Id: 1101​

Deletes the current frame from the document, if the specified placeholder(s) of a frame doesn't have a value. Aborts, if no valid Id is provided.

ParametersExplanationDefault
Placeholder IdNumeric Id of a placeholder to check for values.
warning

All subsequent calls to this item or the item’s children functions will fail.

Delete Frame if no image​

Id: 1102​

Deletes the current frame from the document, if the current frame doesn't have an image.

warning

All subsequent calls to this item or the item’s children functions will fail.

Delete frame if no table​

Id: 1103​

Deletes the current frame from the document, if the current frame doesn't contain any tables.

warning

All subsequent calls to this item or the item’s children functions will fail.

Fit Frame with Limits​

Id: 1104​

Executes the CFrame.fit()-method but takes a specified minimum and/or maximum height into account. Won't resize a frame lower than the current page's bottom.

ParametersExplanationDefault
Reference PointOne of the following reference points: TopLeft, TopCenter, TopRight, LeftCenter, Center, RightCenter, BottomLeft, BottomCenter, BottomRightTopLeft
Constant WidthWhen the text content is on a single line, should we keep the width? No: 0, Yes: 10
Minimum HeightFit the frame not smaller than this minimum height. Specify as Float: 3.14. Leave at 0 to not set a minimum height.0
Maximum HeightFit the frame not larger than this maximum height. Specify as Float: 3.14. Leave at 0 to not set a maximum height. Set to -1(or any value < 0) to expand frame to bottom of pagetemplate.0

Justify Frame at Pageborder​

Id: 1105​

ParametersExplanationDefault
Lean atleft, center (x), right, top, center (y), bottomleft
Offset (mm)float-value0.0
Fix opposite edgeno, yesno

Position Frame Below Several Frames​

Id: 1106​

ParametersExplanationDefault
y-Offset in mm
Frames listcommaseparated e.g. a,b,c
Following framescommaseparated e.g. a,b,c

Position Frame Next to several Frames​

Id: 1107​

ParametersExplanationDefault
x-offset in mm 
Frame Listcommaseparated e.g. a,b,c

Scale Frame​

Id: 1108​

Resize a frame based on a scaling-factor (default is 1.0).

ParametersExplanationDefault
Scaling X1.0
Scaling Y1.0
Fixpoint Xleft, center, right
Fixpoint Ytop, center, bottom

Set Overset Marker​

Id: 1109​

Places an icon similar to the overset-marker of InDesign at the bottom-right corner of an element. By default the rule checks for overset, before placing the marker; can be disabled.

ParametersExplanationDefault
Check for Oversettrue, falsetrue
Only during trace-modetrue, falsetrue

Overset Marker InDesign and Comet Layoutrule

Expand to Bleed​

Id: 1112​

ParametersExplanationDefault
Bleed Left or Innernone, doc, page or float-valuenone
Bleed Topnone, doc, page or float-valuenone
Bleed Right or Outernone, doc, page or float-valuenone
Bleed Bottomnone, doc, page or float-valuenone

Resize Keep Distance to Frame​

Id: 1113​

ParametersExplanationDefault
Reference FrameOne of the template's frames by label 
Reference Point (fixed side)TopCenter, LeftCenter, RightCenter, BottomCenterTopCenter
Distance Float-value 

Set Size​

Id: 1114​

ParametersExplanationDefault
Width in mmInteger or Float in mm; Empty = leave unchanged. --pageelement-- = Width of current pageelement 
Height in mmInteger or Float in mm; Empty = leave unchanged. --pageelement-- = Height of current pageelement
Limit to Edge of Pageelementtrue, falsetrue 

Apply Style​

Id: 1115​

Applies a style-property based on the selected options. For examplenamed styles or fill-color based on values or swatchname.

ParametersExplanationDefault
Style Typecmyk-values-fill, rgb-values-fill, hex-values-fill, swatch-fill, objectstyle, paragraphstyle, tablestylecmyk-values-fill 
Style DefinitionStylename or Colorvalues matching the selected style-type. Styles by name need to exist in the document. Colorvalues need to match the selected color-model.0,100,0,0

Draw Line​

Id: 1116​

Draw a line between two points of the current frame.

ParametersExplanationDefault
Point 1TopLeft
TopCenter
TopRight
LeftCenter
Center
RightCenter
BottomLeft
BottomCenter
BottomRight
TopLeft
Point 2TopLeft
TopCenter
TopRight
LeftCenter
Center
RightCenter
BottomLeft
BottomCenter
BottomRight
TopLeft
Line Thickness (mm)Value in mm as float0.5
FillcolorCommaseparated cmyk- or rgb-values or swatchname0,100,0,0

Magnets​

My fix magnets​

Id: 1200​

ParametersExplanationDefault

Turn on placeholders magnets​

Id: 1201​

ParametersExplanationDefault

Remove magnets​

Id: 1202​

ParametersExplanationDefault

Tables​

Delete row if no value​

Id: 1300​

ParametersExplanationDefault
Column Indexes0-based, commaseparated list 0
Placeholder-Indexescommaseparated list of placeholder-indexes in cells (0-based) none
Row-IndexesLimit the action to certain rows specified by index (0-based, commaseparated list)none 
Ignore HeaderrowsNo: 0, Yes: 1 0

Delete empty row of main table​

Id: 1301​

ParametersExplanationDefault

Intelligent Table Adaption​

Id: 1302​

ParametersExplanationDefault
TablesList of chosen tables of the active frame [1,2,3,...] or starting at the last table [-1,-2,-3,...], 0 = all tables0
Fixed ColumnList of columns that shall get a fixed width [1,2,3,...] or starting at the last column [-1,-2,-3,...]
Fixed WidthList of column widths [in mm] in the same order as gParam2 [20.5,28.0,35.2,...]

Set Table Style​

Id: 1303​

ParametersExplanationDefault
Column index
Style
Apply on headers?no, yes

Change row style if value in cell​

Id: 1304​

ParametersExplanationDefault

Remove Cell Style Overrides​

Id: 1305​

ParametersExplanationDefault

Reorder table​

Id: 1306​

ParametersExplanationDefault

Remove Rows​

Id: 1307​

ParametersExplanationDefault
Table IndexA numeric index of the nth table in the frame0
Row IndexesCommaseparated list of row indexes. For example: 0,1,-2,-1-1

Remove Column​

Id: 1308​

ParametersExplanationDefault
Table Indexint, 0-based0
Column Indexint, 0-based0

Set Cell Style​

Id: 1309​

ParametersExplanationDefault
Cellstyle
Table Indexint, 0-based0
Cell range (indexes)Commaseparated list of indexes for the cellrange (l,t,r,b)
Overrides Commasepareted list of integers (as boolean-representation): Clear Cellstyle Overrides: 0/1, Apply Paragraphstyl: 0/1 1,1

Merge Cells with same Content​

Id: 1310​

ParametersExplanationDefault
Indexes of TableCommaseparated list of indexes of tables in the frame in which cells should be merged. Leave empty to search all tables.
Directioncolumns or rowscolumns
Indexes of colums or rowsCommaseparated list of indexes of columns or cells in which cells should be merged. Leave empty to search all columns / rows.
Type of cellcontent for comparison taggedtext or placeholders or plaintext or netweight taggedtext

Text​

Activate textwraps​

Id: 1400​

ParametersExplanationDefault
placeholderIDType: Integer0

Search and Replace in Text​

Id: 1401​

Implements similar functionality as the default Text-Layoutrule to Search and Replace. The search string may be a regular expression. Use prefix regexp: or pcre: to mark a search string as a regular expression. Comet-PDF doesn't support Text-Layoutrules currently.

ParametersExplanationDefault
SearchThe search string may be a regular expression. Use prefix regexp: or pcre: to mark a search string as a regular expression. To escape (in regex usually backslashes) use // (double forwardslashes). Example: (//d+)
Replace byReplacement-String can include Regex-Groupreferences. To escape (in regex usually backslash) use // (double forwardslashes).
Placeholder Indexes0-based indexes of placeholders within the Frame (commaseparated list). If no values are given, complete frame content is used. Example: "number: //1"
Search Counterall, firstall

Transform Date Text​

Id: 1402​

ParametersExplanationDefault
Placeholder ID
Input Date Typeddmmyyyy
ddmmyyyy_hhmm
ddmmyyyy_hhmmss
dmyy
hhmm
hhmmss
hmm
hmmss
yyyymmddhhmmss
xmldatetime
iso_time_colon
iso_time_hyphen
iso_date
iso_date_time_colon
iso_date_time_hyphen
ddmmyyyy
Output Date Typeddmmyyyy
ddmmyyyy_hhmm
ddmmyyyy_hhmmss
dmyy
hhmm
hhmmss
hmm
hmmss
yyyymmddhhmmss
xmldatetime
iso_time_colon
iso_time_hyphen
iso_date
iso_date_time_colon
iso_date_time_hyphen
ddmmyyyy

Replace Placeholder Content​

Id: 1403​

ParametersExplanationDefault
Placeholder IdID of placeholder to limit search to. If ID=0 search is not filtered for placeholder IDs0
IndexIndex of Placeholder in Frame. If Placeholder ID is given, the Index counts only for placeholders with this ID.
Replacement Text0

Insert Delimiters between Placeholders​

Id: 1404​

ParametersExplanationDefault
Delimiter

Reduce Fontsize On Overset​

Id: 1405​

Resizes text if the frame has overset until a minimum size is reached. Supports applying a cached minimum value from a previous execution of the rule using the same caching-key. For full syncing of minimum size between frames using the same caching-key, implement the function sync_fontsize_in_frames of the pageitems-library in the buildscript after the desired frames have been established.

ParametersExplanationDefault
Minimum FontsizeMinimum Size of Font. As Floatvalue in Points. Below 0.1 is not allowed.0.1
Steps for Resizing and LeadingSize of Steps by which the fontsize is reduced and the difference to Leading. As Floatvalue in Points0.1,0.0
Placeholder IndexIndex and Id of placeholder, where the fontsize should be reduced. Empty to resize complete text of frame.all,0
Caching KeyKey of Comet-Attribute in which the new smallest Fontsize is saved. If a value is found upon execution, resizing starts at this value.minimum_fontsize