comet

The comet module is the primary service provider for comet related functionality

Methods

comet.getContext()

Fetches the script context in which this script is called. Depending on the type of action, scripts can be reused for multiple situations (e.g. different placeholder calls can use the same action like placeholder load and placeholder sync).

Returns

Context this script is called in. See Contexts

Return type

int

Available

comet.getVersion()

Determine the current comet version.

Returns

The comet version

Return type

str

Available

comet.getRevision()

Determine the current comet revision.

Returns

The comet revision

Return type

str

Available

comet.setOutput(identifier, value)

Set an output variable depending on the active context. This function is used to provide comet with necessary information in callback contexts. e.g. when dynamically defining function variables it is necessary to fill the variable ‘gFuncVars’ with a predefined data structure to provide comet with the necessary information to properly establish the function variables.

The type of the output variable value is dynamic and depends on the context and variable. For a table of output variables and their types by context, see Output variables

Parameters
  • identifier (str) – The variable identifier. Must match a variable available in the context.

  • value – The new variable value. Must match the variable type required in this context.

Returns

None

Raises
  • TypeError

    • When parameter types are invalid

    • When parameter type of value does not match the required type

  • CometError – On internal error

Available

comet.getKeyValue(key, frame=None, index=0, length=- 1)

Query the value of a keyword.

In placeholder scripts with direct statements and in panel statements a number of <tags> are defined which are replaced with their current values before the statement is executed.

A complete list of these tags can be found here.

In scripts, you can ask for these values directly in a number of ways. To simplify matters, this function can be used to obtain the values in a uniform manner.

Parameters
  • key (str) – The key to query, without pointed brackets

  • frame (CFrame) –

    Associated frame. For frame-independent keys like ‘now’ or ‘user’ the parameter is is not needed.

    • None: Use gFrame when available

  • index (int) –

    Character index in the text to query the value.

    The parameter is only needed for text-related keys like ‘text’.

  • length (int) –

    Character length in the text to query the value.

    The parameter is only needed for text-related keys like ‘text’.

Returns

The resolved value

Return type

str

Raises
CScript

system::key_value

comet.wlog(message, targetFile='', addNewLine=True)

Write a message to the logfile

Parameters
  • message (str) – The message to write

  • targetFile (str) – Path of the log file. If the path is empty, the standard log file is used when it is enabled.

  • addNewLine (bool) – Automatically add a line break at the end of the message?

Returns

None

Raises

TypeError – When parameter types are invalid

Available

CScript

wlog

comet.wtlog(message, targetFile='', addNewLine=True)

Write a message to the logfile with the current time as prefix in the format dd.mm.yyyy hh:mm:ss, e.g.

30.06.2021 14:13:47

Parameters
  • message (str) – The message to write

  • targetFile (str) – Path of the log file. If the path is empty, the standard log file is used when it is enabled.

  • addNewLine (bool) – Automatically add a line break at the end of the message?

Returns

None

Raises

TypeError – When parameter types are invalid

Available

CScript

wtlog

comet.showMessage(message)

Display a message dialog. The message automatically is translated according to translation tables.

Outputs a message to the console instead of showing a dialog

Parameters

message (str) – The message to show

Returns

None

Raises

TypeError – When parameter types are invalid

Available

comet.showError(message)

Display an error dialog. The message automatically is translated according to translation tables.

Outputs a message to the console instead of showing a dialog

Parameters

message (str) – The message to show

Returns

None

Raises

TypeError – When parameter types are invalid

Available

comet.uncurtain(input)

Uncurtain all available $-keys in the given string. $-keys are not only the standards $HOME, $DESKTOP, $DOCUMENTS, $PREFS, $PLUGINS, $COMET, $CACHE and $COMETDATA, but also all activated aliases defined in the Settings panel.

Parameters

input (str) – The input string to uncurtain

Returns

The input string with all possible aliases resolved

Return type

str

Raises

TypeError – When parameter types are invalid

Available

comet.pyImport(path)

Try to import a module from a comet datapool where the path may contain special import tokens which are dynamically resolved to the current data connection.

See Import directives for details

Parameters

path (str) – The path in comet import directive syntax

Returns

The imported module

Return type

Module

Raises
Available

comet.mm2pt(value)

Converts a value from milimeters to pt.

Parameters

value (float) – The value to convert

Returns

The converted value

Return type

float

Raises

TypeError – When parameter types are invalid

Available

CScript

mm2pt

comet.pt2mm(value)

Converts a value from pt to milimeters.

Parameters

value (float) – The value to convert

Returns

The converted value

Return type

float

Raises

TypeError – When parameter types are invalid

Available

CScript

pt2mm

comet.inch2pt(value)

Converts a value from inch to pt.

Parameters

value (float) – The value to convert

Returns

The converted value

Return type

float

Raises

TypeError – When parameter types are invalid

Available

CScript

inch2pt

comet.pt2inch(value)

Converts a value pt to inch.

Parameters

value (float) – The value to convert

Returns

The converted value

Return type

float

Raises

TypeError – When parameter types are invalid

Available

CScript

pt2inch

comet.translate(value, findKey=False)

Try to translate the input value by looking up the internal translation tables. When findKey is True, the value is considered already translated and the search tries to find the translation key. Current locale of the host software applies.

Parameters
  • value (str) – Either the value to translate (findKey = False) or the translated value to find the key for (findKey = True)

  • findKey (bool) – Whether to search for a translation (False) or a key for a translation (True)

Returns

The translated value. Returns the same as value when value was not found in translation tables

Return type

str

Raises
Available

comet.beep()

Outputs a beep sound.

Returns

None

Available

CScript

beep

comet.isShiftKeyPressed()

Is the shift pressed?

Returns

Whether the alt key is pressed

Return type

bool

Available

CScript

shiftkey

comet.isAltKeyPressed()

Is the alt key pressed?

Returns

Whether the alt key is pressed

Return type

bool

Available

CScript

altkey

comet.isCtrlKeyPressed()

Is the control key pressed?

Returns

Whether the alt key is pressed

Return type

bool

Available

CScript

controlkey

comet.runJavaScript(input, isPath=False, showErrors=False, flags=0, items=[])

Run a JavaScript (Extendscript).

For additional information see Calling other scripts

Parameters
  • input (str) –

    Either the complete script text as a string, or a full path to a file containing the script.

    When the parameter is a path, set isPath to True.

    If the parameter is a path, the file is expected to be UTF-8 encoded!

  • isPath (bool) –

    • True: input is the path to a script file

    • False: input is a script itself

  • showErrors (bool) –

    Show error dialogs on script errors?

  • flags (int) –

    The undo behavior of the script:

    • 0: Each script statement gets a separate undo step.

    • 2: Push the entire script as a single regular undo step.

      If an error occurs, roll back to the beginning of the script request that generated the error.

    • 4: Similar to 2, however faster because we don’t snapshot each script request.

      If an error occurs, we roll back to the beginning of the entire script.

    • 6: Push the entire script as a single auto-undoable step.

  • items (list) –

    Objects which are converted to global variables in your JavaScript, see Calling other scripts.

    This parameter creates JavaScript variables named gItemRef1, gItemRef2, etc..

    When these objects are inside a document or are documents themselves, they also create the according document variables gDocRef1, gDocRef2, etc..

    Furthermore, two global arrays names gItemRefs and gDocRefs are created containing all objects. The ItemRefs are being converted to their appropriate JavaScript objects.

    The following table shows all supported object types:

    Object

    ClassID

    JavaScript Type

    CDocument

    0xe01

    Document

    CFrame

    0x6201

    PageItem

    CTable

    0xb608

    Table

Returns

The value returned by the script itself.

The value is always is converted to str - if you need another return type you will have to convert it yourself.

Return type

str

Raises
  • TypeError – When parameter types are invalid

  • ValueError – When parameter input is empty

  • FileNotFoundError – When parameter isPath is True and input does not point to an existing file

  • CometError

    • On internal error

    • When the script fails

Available

CScript

run_javascript

comet.runCScript(input, isPath=False, showErrors=False, items=[], logExecution=False)

Run a CScript.

For additional information see Calling other scripts

Parameters
  • input (str) –

    Either the complete script text as a string, or a full path to a file containing the script.

    When the parameter is a path, set isPath to True.

    If the parameter is a path, the file is expected to be UTF-8 encoded!

  • isPath (bool) –

    • True: input is the path to a script file

    • False: input is a script itself

  • showErrors (bool) –

    Show error dialogs on script errors?

  • items (list) –

    Objects which are converted to global variables in your CScript, see Calling other scripts.

    For each entry in this list, a global variable in the executed CScript is created. These variables are accessible in your CScript like intrinsic global variables (gFrame etc…).

    Entries can be:

    • tuple [type, str]

      Variable type, variable name.

      The name must be a non-empty unique valid CScript variable name.

      It is therefore a good idea to use a unique prefix for your variables, e.g. with ‘py’ which is not used as an intrinsic prefix in comet.

    • type

      Variable type.

      In this case an automatic name is generated starting with gItemRef1 and counting upwards: gItemRef2, … gItemRefN.

    For a complete list of all supported variable types, see Calling other scripts.

    The variable values do not change, even if they are changed in CScript.

    e.g. an input variable of type list [str] which is converted to a StringList in CScript and manipulated there, remains unchanged in Python.

    The variables must not be released in your CScript!

  • logExecution (bool) – Write to log that a script is being executed, including script name, ID, execution time etc…

Returns

The return value of the main function of the script

Return type

int

Raises
  • TypeError – When parameter types are invalid

  • ValueError

    • When parameter input is empty

    • When parameter items contains a tuple with an empty name

  • FileNotFoundError – When parameter isPath is True and input does not point to an existing file.

  • CometError

    • On internal error

    • When the script fails

Available

comet.getScriptClipboard(key)

Get a value from the script clipboard.

A copy of the value is returned, not the value itself.

For more information about supported data types, the script stack, the script clipboard and the stored values see here .

Parameters

key (str) – The key to fetch the value for.

Returns

The found value

Raises
  • TypeError – When parameter types are invalid.

  • ValueError – When parameter key is empty.

  • KeyError – When the clipboard does not contain an entry for key.

Available

CScript

get_script_clipboard

comet.setScriptClipboard(key, value, autoDelete=True)

Set a value in the script clipboard.

When the key already exists it is overwritten.

A copy of the value is stored, not the value itself.

For more information about supported data types, the script stack, the script clipboard and the stored values see here .

Parameters
  • key (str) – The key to set the value for.

  • value – The value to set.

  • autoDelete (bool) – Whether to delete the value after the last script on the stack has finished executing.

Return type

None

Raises
Available

CScript

set_script_clipboard

comet.clearScriptClipboard()

Clear the memory of the script clipboard, deleting all stored values.

For more information about supported data types, the script stack, the script clipboard and the stored values see here .

Return type

None

Available

CScript

clear_script_clipboard

Constants

The comet module has a number of constant members which are either used as convenience values for function parameter calls, or as returned values.

Host environments

comet.kHostInDesign = 0

InDesign®

comet.kHostInDesignServer = 1

InDesign® Server

comet.kHostCometPDF = 2

comet_pdf

comet.kHostIllustrator = 3

Illustrator®

kHosts
{ 0: 'kHostInDesign',
  1: 'kHostInDesignServer',
  2: 'kHostCometPDF',
  3: 'kHostIllustrator'}

Designate

comet.kDesignateUndef = 0

Undefined

comet.kDesignateCursor = 1

At cursor

comet.kDesignateSelected = 2

Selection

comet.kDesignateDocument = 3

Document

comet.kDesignateVisibleLayers = -1

Visible layers

comet.kDesignateActiveLayer = -2

Active layer

kDesignate
{ 0: 'kDesignateUndef',
  1: 'kDesignateCursor',
  2: 'kDesignateSelected',
  3: 'kDesignateDocument',
  -1: 'kDesignateVisibleLayers',
  -2: 'kDesignateActiveLayer'}

Contexts

comet.kContextUnknown = -1
comet.kContextPlaceHolderLoad = 0
comet.kContextPlaceHolderSync = 1
comet.kContextPlaceHolderStore = 2
comet.kContextPlaceHolderBuild = 3
comet.kContextPlaceHolderBuildPost = 4
comet.kContextPlaceHolderPrefix = 5
comet.kContextPlaceHolderPostfix = 6
comet.kContextPanelAction = 7
comet.kContextLayoutRule = 8
comet.kContextLayoutRuleCondition = 9
comet.kContextLayoutRuleDynamicList = 10
comet.kContextProductBuildPre = 11
comet.kContextBuildSupport = 12
comet.kContextFuncVarDynamicDef = 13
comet.kContextFuncVarAvailValues = 14
comet.kContextBatch = 15
comet.kContextDoubleClickProductPool = 16
comet.kContextDoubleClickPublications = 17
comet.kContextDoubleClickPreviews = 18
comet.kContextExtendScript = 19
comet.kContextAllowLogin = 20
comet.kContextAfterLogin = 21
comet.kContextXMLScript = 22
comet.kContextCometTestPreScript = 23
comet.kContextCometTestScript = 24
comet.kContextCometTestPostScript = 25
comet.kContextPlaceHolderStringCompare = 26
comet.kContextDocWatch = 27
comet.kContextURLLinkDestFolder = 28
comet.kContextURLLinkHeaderData = 29
comet.kContextURLDropActionID = 30
comet.kContextURLDrop = 31
comet.kContextAlternativeTemplate = 32
comet.kContextTableModuleInsertRow = 33
comet.kContextTableModuleOmitRow = 34
comet.kContextTableModuleInsertColumn = 35
comet.kContextTableModuleOmitColumn = 36
comet.kContextTableModuleLayoutRule = 37
comet.kContextTableModuleCellID = 38
comet.kContextPublicationCheckout = 39
comet.kContextPublicationAfterSave = 40
comet.kContextPublicationBeforeClose = 41
comet.kContextPublicationStatus = 42
comet.kContextPublicationCheckin = 43
comet.kContextPublicationAfterClose = 44
comet.kContextPublicationRevert = 45
comet.kContextPublicationAfterCheckout = 46
comet.kContextNoteParastyle = 47
comet.kContextNoteTargetLayer = 48
comet.kContextPODSpecialCases = 49
comet.kContextProductPoolEntries = 50
comet.kContextProductPoolSFDefaultValue = 51
comet.kContextToDoListCustomTask = 52
comet.kContextPreviewsEntries = 53
comet.kContextPageTemplateAfterApply = 55
comet.kContextServerInterface = 56
comet.kContextStampAction = 57
comet.kContextExcelQueryFunction = 58
kContexts
{ -1: 'kContextUnknown',
  0: 'kContextPlaceHolderLoad',
  1: 'kContextPlaceHolderSync',
  2: 'kContextPlaceHolderStore',
  3: 'kContextPlaceHolderBuild',
  4: 'kContextPlaceHolderBuildPost',
  5: 'kContextPlaceHolderPrefix',
  6: 'kContextPlaceHolderPostfix',
  7: 'kContextPanelAction',
  8: 'kContextLayoutRule',
  9: 'kContextLayoutRuleCondition',
  10: 'kContextLayoutRuleDynamicList',
  11: 'kContextProductBuildPre',
  12: 'kContextBuildSupport',
  13: 'kContextFuncVarDynamicDef',
  14: 'kContextFuncVarAvailValues',
  15: 'kContextBatch',
  16: 'kContextDoubleClickProductPool',
  17: 'kContextDoubleClickPublications',
  18: 'kContextDoubleClickPreviews',
  19: 'kContextExtendScript',
  20: 'kContextAllowLogin',
  21: 'kContextAfterLogin',
  22: 'kContextXMLScript',
  23: 'kContextCometTestPreScript',
  24: 'kContextCometTestScript',
  25: 'kContextCometTestPostScript',
  26: 'kContextPlaceHolderStringCompare',
  27: 'kContextDocWatch',
  28: 'kContextURLLinkDestFolder',
  29: 'kContextURLLinkHeaderData',
  30: 'kContextURLDropActionID',
  31: 'kContextURLDrop',
  32: 'kContextAlternativeTemplate',
  33: 'kContextTableModuleInsertRow',
  34: 'kContextTableModuleOmitRow',
  35: 'kContextTableModuleInsertColumn',
  36: 'kContextTableModuleOmitColumn',
  37: 'kContextTableModuleLayoutRule',
  38: 'kContextTableModuleCellID',
  39: 'kContextPublicationCheckout',
  40: 'kContextPublicationAfterSave',
  41: 'kContextPublicationBeforeClose',
  42: 'kContextPublicationStatus',
  43: 'kContextPublicationCheckin',
  44: 'kContextPublicationAfterClose',
  45: 'kContextPublicationRevert',
  46: 'kContextPublicationAfterCheckout',
  47: 'kContextNoteParastyle',
  48: 'kContextNoteTargetLayer',
  49: 'kContextPODSpecialCases',
  50: 'kContextProductPoolEntries',
  51: 'kContextProductPoolSFDefaultValue',
  52: 'kContextToDoListCustomTask',
  53: 'kContextPreviewsEntries',
  54: 'kContextPreviewsLink',
  55: 'kContextPageTemplateAfterApply',
  56: 'kContextServerInterface',
  57: 'kContextStampAction',
  58: 'kContextExcelQueryFunction'}

Action types

comet.kActionTypeLoad = 1

Placeholder load action

comet.kActionTypeStore = 2

Placeholder store action

comet.kActionTypeSync = 3

Placeholder sync action

comet.kActionTypeBuild = 4

Placeholder build action for repeating elements

kActionTypes
{ 1: 'kActionTypeLoad',
  2: 'kActionTypeStore',
  3: 'kActionTypeSync',
  4: 'kActionTypeBuild'}

Indices

comet.kStart = 0

Start

comet.kEnd = -1

End

comet.kTotalEnd = -3

End including tables

kIndices
{0: 'kStart', -1: 'kEnd'}

Sides

comet.kSideLeft = 1

Left

comet.kSideRight = 4

Right

comet.kSideTop = 2

Top

comet.kSideBottom = 8

Bottom

comet.kSideAll = 15

All sides

kSides
{ 0: 'kSideNone',
  1: 'kSideLeft',
  4: 'kSideRight',
  2: 'kSideTop',
  8: 'kSideBottom',
  15: 'kSideAll'}

Reference Points

comet.kRefPointTopLeft = 0
comet.kRefPointTopCenter = 1
comet.kRefPointTopRight = 2
comet.kRefPointLeftCenter = 3
comet.kRefPointCenter = 4
comet.kRefPointRightCenter = 5
comet.kRefPointBottomLeft = 6
comet.kRefPointBottomCenter = 7
comet.kRefPointBottomRight = 8
kReferencePoints
{ 0: 'kRefPointTopLeft',
  1: 'kRefPointTopCenter',
  2: 'kRefPointTopRight',
  3: 'kRefPointLeftCenter',
  4: 'kRefPointCenter',
  5: 'kRefPointRightCenter',
  6: 'kRefPointBottomLeft',
  7: 'kRefPointBottomCenter',
  8: 'kRefPointBottomRight'}

Text formats

Format specifications with the identifier Plus in the name additionally replace all automatic page numbers, paragraph names and footnote markers by their current values.

comet.kExportPlain = 0

Export purely unformatted text of the document. Characters greater 127 not defined in the extented ASCII set of Windows and Macintosh are coded in the format <00AD>.

comet.kExportTagged = 1
comet.kExportTT = 2
comet.kExportW2 = 3
comet.kExportUnitext = 4
comet.kExportXUnitext = 5
comet.kExportPlainWithTables = 7
comet.kExportUnitextWithTables = 8
comet.kExportXUnitextWithTables = 9
comet.kExportPlainNoTypografics = 10
comet.kExportPlainWithTablesNoTypografics = 11
comet.kExportHTML = 12
comet.kExportHTMLWithTables = 13
comet.kExportRTF = 14
comet.kExportXMLUnitext = 15
comet.kExportXMLUnitextWithTables = 16
comet.kExportHTMLWithStyles = 17
comet.kExportW2Raw = 18
comet.kExportPlusPlain = 19
comet.kExportPlusUnitext = 20
comet.kExportPlusXUnitext = 21
comet.kExportPlusXMLUnitext = 22
comet.kExportPlusPlainNoTypografics = 23
comet.kExportPlusHTML = 24
comet.kExportW2ML = 25
comet.kExportHTMLWithStylesAndCSS = 26
kTextFormats
{ 0: 'kExportPlain',
  1: 'kExportTagged',
  2: 'kExportTT',
  3: 'kExportW2',
  4: 'kExportUnitext',
  5: 'kExportXUnitext',
  7: 'kExportPlainWithTables',
  8: 'kExportUnitextWithTables',
  9: 'kExportXUnitextWithTables',
  10: 'kExportPlainNoTypografics',
  11: 'kExportPlainWithTablesNoTypografics',
  12: 'kExportHTML',
  13: 'kExportHTMLWithTables',
  14: 'kExportRTF',
  15: 'kExportXMLUnitext',
  16: 'kExportXMLUnitextWithTables',
  17: 'kExportHTMLWithStyles',
  18: 'kExportW2Raw',
  19: 'kExportPlusPlain',
  20: 'kExportPlusUnitext',
  21: 'kExportPlusXUnitext',
  22: 'kExportPlusXMLUnitext',
  23: 'kExportPlusPlainNoTypografics',
  24: 'kExportPlusHTML',
  25: 'kExportW2ML',
  26: 'kExportHTMLWithStylesAndCSS'}

Pageitem types

comet.kPageItemTypeUnknown = -1
comet.kPageItemTypeText = 0
comet.kPageItemTypeGraphic = 1
comet.kPageItemTypeGroup = 2
comet.kPageItemTypeLegacyText = 3
comet.kPageItemTypeGraph = 4
comet.kPageItemTypeGuide = 5
comet.kPageItemTypeQRCode = 6
kPageItemTypes
{ -1: 'kPageItemTypeUnknown',
  0: 'kPageItemTypeText',
  1: 'kPageItemTypeGraphic',
  2: 'kPageItemTypeGroup',
  3: 'kPageItemTypeLegacyText',
  4: 'kPageItemTypeGraph',
  5: 'kPageItemTypeGuide',
  6: 'kPageItemTypeQRCode'}

List types

comet.kListTypeNone = 0
comet.kListTypeBullet = 1
comet.kListTypeNumbered = 2
kListTypes
{0: 'kListTypeNone', 1: 'kListTypeBullet', 2: 'kListTypeNumbered'}

Basic types

comet.kInt = 1
comet.kFloat = 2
comet.kString = 3
kBasicTypes
{1: 'kInt', 2: 'kFloat', 3: 'kString'}

Layout rule situations

comet.kLayoutRuleSituationCreate = 1

After creation

comet.kLayoutRuleSituationLoad = 2

After loading

comet.kLayoutRuleSituationReorganize = 4

After reorganization

comet.kLayoutRuleSituationGeometryChange = 8

After geometry change

comet.kLayoutRuleSituationBuild = 32

After build

comet.kLayoutRuleSituationAll = 4294967295
kLayoutRuleSituations
{ 1: 'kLayoutRuleSituationCreate',
  2: 'kLayoutRuleSituationLoad',
  4: 'kLayoutRuleSituationReorganize',
  8: 'kLayoutRuleSituationGeometryChange',
  32: 'kLayoutRuleSituationBuild',
  4294967295: 'kLayoutRuleSituationAll'}

Style types

comet.kStyleTypeObject = 1

Object style

comet.kStyleTypeTable = 2

Table style

comet.kStyleTypeCell = 3

Cell style

comet.kStyleTypeParagraph = 4

Pragraph style

comet.kStyleTypeCharacter = 5

Character style

kStyleTypes
{ 1: 'kStyleTypeObject',
  2: 'kStyleTypeTable',
  3: 'kStyleTypeCell',
  4: 'kStyleTypeParagraph',
  5: 'kStyleTypeCharacter'}

Page types

comet.kPageTypeUnknown = -1

Not found or could not be determined

comet.kPageTypeLeft = 0

Left page

comet.kPageTypeUnisex = 1

Inner page or page of a spread with a single page

comet.kPageTypeRight = 2

Right page

kPageTypes
{ -1: 'kPageTypeUnknown',
  0: 'kPageTypeLeft',
  1: 'kPageTypeUnisex',
  2: 'kPageTypeRight'}

Panel IDs

comet.kPanelUndef = 0
comet.kPanelProducts = 3
comet.kPanelPreviews = 6
comet.kPanelPageitems = 8
comet.kPanelPublications = 9
comet.kPanelToDoList = 10
comet.kPanelPlaceholder = 125
comet.kPanelPlaceholderValues = 401
comet.kPanelPageitemsBehavior = 402
comet.kPanelCometAdmin = 405
comet.kPanelLayoutRules = 408
comet.kPanelFrameTags = 409
comet.kPanelAreaBuild = 410
comet.kPanelPriintAdjust = 411
comet.kPanelPriintAdjustList = 412
comet.kPanelPlaceholderValuesInfo = 413
comet.kPanelFrontRow = 414
comet.kPanelNotes = 415
comet.kPanelPreviewDetails = 416
comet.kPanelProductsOfDocument = 417
comet.kPanelPublicationInfo = 418
comet.kPanelSettings = 419
comet.kPanelCometTests = 420
comet.kPanelDocumentAttributes = 500
kPanelIDs
{ 0: 'kPanelUndef',
  3: 'kPanelProducts',
  6: 'kPanelPreviews',
  8: 'kPanelPageitems',
  9: 'kPanelPublications',
  10: 'kPanelToDoList',
  125: 'kPanelPlaceholder',
  401: 'kPanelPlaceholderValues',
  402: 'kPanelPageitemsBehavior',
  405: 'kPanelCometAdmin',
  408: 'kPanelLayoutRules',
  409: 'kPanelFrameTags',
  410: 'kPanelAreaBuild',
  411: 'kPanelPriintAdjust',
  412: 'kPanelPriintAdjustList',
  413: 'kPanelPlaceholderValuesInfo',
  414: 'kPanelFrontRow',
  415: 'kPanelNotes',
  416: 'kPanelPreviewDetails',
  417: 'kPanelProductsOfDocument',
  418: 'kPanelPublicationInfo',
  419: 'kPanelSettings',
  420: 'kPanelCometTests',
  421: 'kPanelURLLink',
  500: 'kPanelDocumentAttributes'}

Sync states

comet.kSyncStateUndefined = -6

State undefined

comet.kSyncStateOverridden = -5

State overridden

comet.kSyncStateLoadError = -4

Error while trying to ascertain sync state

comet.kSyncStateNoMarker = -3

No state marker set yet

comet.kSyncStateNotFound = -2

Object not found

comet.kSyncStateChanged = -1

Changed

comet.kSyncStateRemoved = 0

Removed

comet.kSyncStateOk = 1

Ok

comet.kSyncStateNotUnique = 2

Object not unique

kSyncStates
{ -6: 'kSyncStateUndefined',
  -5: 'kSyncStateOverridden',
  -4: 'kSyncStateLoadError',
  -3: 'kSyncStateNoMarker',
  -2: 'kSyncStateNotFound',
  -1: 'kSyncStateChanged',
  0: 'kSyncStateRemoved',
  1: 'kSyncStateOk',
  2: 'kSyncStateNotUnique'}

Build situations

comet.kSituationCheckSizeBefore = 1
comet.kSituationCheckSizeAfter = 2
comet.kSituationBeforeCreateContinue = 3
comet.kSituationAfterCreateContinue = 4
comet.kSituationProductPlaced = 5
comet.kSituationUnsolvableOversets = 6
comet.kSituationAfterBuild = 20
comet.kSituationProductFinished = 21
kBuildSituations
{ 1: 'kSituationCheckSizeBefore',
  2: 'kSituationCheckSizeAfter',
  3: 'kSituationBeforeCreateContinue',
  4: 'kSituationAfterCreateContinue',
  5: 'kSituationProductPlaced',
  6: 'kSituationUnsolvableOversets',
  20: 'kSituationAfterBuild',
  21: 'kSituationProductFinished'}

Placeholder slots

Placeholder slots are used in conjunction with placeholder.getTagValue() and placeholder.setTagValue()

Identifier (str)

Type

Notes

Placeholder, Platzhalter

int

The associated placeholder definition should exist and be of the correct type.

ID

Object-ID, comprised of three numbers and a string.

ID2

ID3

STRINGID

str

STRINGID1

STRINGID2

STRINGID3

Class

int

Class ID of the object, which can be linked with this placeholder.

Select

int

IDs of the actions which can be executed from the placeholders.

Sync

Update

Lov

ObjectNameID

RelatedTo

Type of the placeholder

1 : text
2 : textframe
3 : imageframe
4 : xmlelement
5 : Document action
6 : multiframe (Repeated Element)
7 : multitext (Repeated Text)
8 : Serial letter placeholder (Plugin Serial letter)
-2000 : Excel-supported table (Pluginin XCell)

Color

ID of a color. The color is used to present the placeholder in the placeholder panel and in the document.

SyncStateInvisible

Can the placeholder display a status (see get_sync) or not?

0 : Do not show
1 : Status can be shown

LoadConstraint

Unused

Format

For repeating elements the ID of the action is specified here which is to be executed if the elements are to be set up

Group

Group ID of a placeholder frame. The group ID is allocated for Document build, so that frames are located on the same grid locations even though these are not grouped in InDesign®.

Name

str

For Excel-supported tables contains the path of the associated Excel table. Relative paths are determined depending on the document.

Table

Check sum, do NOT change!

Created

Date information in the format YYYYMMDDHHMMSS

Modified

Grid

int

Specification of the document build. The value of these fields can be set in the plugin Build rules.

You can use Pre- and PostRule to create new pages :

-1 : New page
-2 : New left page
-3 : New right page

GridElement

PreRule

PostRule

PreRuleParams

str

PostRuleParams

AdParams

Infos1

Additional information to the placeholder. The specifications are limited to 4000 characters. If the specification is longer than 4000 characters, the empty string is used.

Infos1

SequenceNr

int

Sequence in which the frames of a template are loaded during insertion. If no sequence number is specified (0), the frames are loaded in a default order.
The specification only has a meaning when inserting templates that consist of several frames. The same sequence is applied after insertion (PostScript)..

PostScript

After inserting the frame using a template, a post-processing procedure can be executed.
The ID specifies the number of the action to be executed. The actions frame postscripts must have the ClassID 16.
If a template consists of several frames, the sequence of execution can be specified via SequenceNr.

ShowPostScript

Should the sequence number and postscript ID be shown in the document? The display only occurs if placeholders are also displayed.

TextflowType

How to use the frame in case of a text flow?

0 : Insert text content
1 : Insert as inline
2 : Do not insert

TextflowOnly

If the frame is part of a template, this value controls how to deal with the frame in normal (drag’n drop, build products, …) template inserts.

0 : Take this frame to the document
1 : Do not insert this frame into the document unless a text flow build is running.

TextflowUsage

Internal, do not change!

AdaptSequ

Internal, do not change!

AdaptGroup

str

Internal, do not change!

PageitemID

int

ID of the template which built this frame.

Template ID vs. product template ID Imagine a product is built with template 100 and gets frames 1, 2, 3. frame 2 creates two more frames (4 and 5) with document::place_items and template 300.

Until v3.2.3 the frames have the following PageitemID :

  • Frame 1 : 100

  • frame 2 : 100

  • frame 3 : 100

  • Frame 4 : 300

  • Frame 5 : 300

If the document is now reorganized, it can no longer be clearly determined with which template the product was built and the reorganization may now use template 300 for the product instead of the desired template 100. From v3.3 PageitemID therefore contains the unique product template ID for all frames of the product, in this case 100 :

  • Frame 1 : 100

  • Frame 2 : 100

  • Frame 3 : 100

  • Frame 4 : 100

  • Frame 5 : 100

With the value PageitemDirectID you can get the ID of the template with which a frame was inserted.

OrgPageitemID

A product is to be built with a certain template. This template has a TemplateID script and instead of the passed template another template is used. In OrgPageitemID the original templateID is still retained.

e.g.
Product with template 100
TemplateID script of template 100 calculates as ID 110
OrgPageitemID = 100
Pageitem = 110
PageitemDirectID = 110

SmartInfo

str

Information about the template behavior. The string is structured as described in the following table. You can change the content of the SmartInfo.
However, make sure that the string remains syntactically correct according to the following table. The individual fields are separated by spaces.
Incorrect entries can lead to errors in the program and document!
The string can be supplemented by Werk II with further data. Do not add your own data here! You can store your own data in the fields Infos1 and Infos2.

Type

Description

str

Frame label, one character only

int [0-23]

Color-ID

int [0-6]

Page type of the frame

  • 0 : undefined

  • 1 : left

  • 2 : right

  • 3 : continuation left

  • 4 : continuation right

  • 5 : spread

  • 6 : continuation spread

int [0-3]

Continuation type

  • 0 : normal

  • 1 : continue frame (triangle)

  • 2 : repetition (unused)

  • 3 : continue frame with fixed height (empty triangle)

str

Internal ID. Do not change!

int

Flags (bit field)

  • 0x00000001 : Load frame place holders

  • 0x00000002 : Load text place holders

int [0-3]

Area type

  • 0 : Bounding Box

  • 1 : Path (Star)

  • 2 : Path with holes (empty star)

  • 3 : ignore (Minus)

ObjectNameID

int

ID of the action with which the object name can be calculated

BuiltByID

ID of product which built this frame

BuiltByID2

BuiltByID3

BuiltByStringID

str

BuildRemains

int

Number of elements that could not be inserted because the repeating frame is full

Chapter

[unused] Chapter id

ChapterRule

[unused] 0 : new left page, 1 : new page, 2 : new right page

HeightFromTemplate

str

Original height from the template.

OriginBBox

Original bbox of frame from the template. Blank delimited string of four floats.

Prefix

Text to insert into the document before/behind the placeholder, if the placeholder is not empty

Postfix

PrefixIfEmpty

Text to insert into the document before/behind the placeholder, if the placeholder is empty

PostfixIfEmpty

Continue

int

Unique id of the continuing template the frame belongs to.

PageBreakID

New chapter-ID. This ID is shown in left top corner of the Comet groups and is used for page breaks in document reorganizings. All products with the same (or an empty) chapter ID are containing to the same chapter. Every change of the chapter ID forces a page break. Page template and page type are read from PageBreakTemplateID* and PageBreakType. Set the chapter ID in all frames of a Comet group. By default we use page UIDs as to be chapter IDs, but you may use any unique number here. Good candidates may be the Comet group ID or the UID of a frame of the list.

PageBreakTemplateID

Page template applied to the new page. You may use same page template as in the previous chapter.

PageBreakType

  • 0 : new left page

  • 1 : new page

  • 2 : new right page

PageBreakLayers

str

Layout layers for the chapter. Include all layers into double quotas and use single blanks as delimiters. The given layers must not exist in the document. Use the following definitions for variable layers

  • “ab++#–background” : All layers behind the current

  • “ab++#–except layerName” : All layers except layerName

  • “ab++#–behind layerName” : All layers behind layerName

RepetitionParent

int

UID of repetition parent. If the frame was not created as a repetition child, the value is 0.

LayoutRules

str

String for defining the layout rules.

StaticLink

int

Static product link property of place holder

BuildUsage

How should the frame be used in text flow builds?

  • 0 : Insert content

  • 1 : Insert frame as inline

  • 2 : Do not use

FunctionVariables

str

Function Variables

HashValues

Fixed contents of the placeholder

Publication selectors

Publication selectors are used in conjunction with the publication classes like CPublication and their functions like CPublication.getValue().

The following table indicates which selector can be used with the getValue function of each publication class.

Selector

Data type

CPublication

CPublicationType

CParameter

CPlanning

CWorkflowStatus

comet.kPublicationID = 1

int

comet.kPublicationID2 = 2

int

comet.kPublicationID3 = 3

int

comet.kPublicationStringID = 23

str

comet.kPublicationInfo = 5

str

comet.kPublicationName = 6

str

comet.kPublicationLabel = 7

str

comet.kPublicationType = 8

CParameter: int
else: str

comet.kPublicationStatus = 9

str

comet.kPublicationInfo1 = 10

str

comet.kPublicationInfo2 = 11

str

comet.kPublicationDomain = 12

str

comet.kPublicationPath = 13

str

comet.kPublicationURL = 14

str

comet.kPublicationCanOverrideURL = 15

bool

comet.kPublicationCanOverrideLocal = 16

bool

comet.kPublicationHasChildren = 17

bool

comet.kPublicationStatementID = 18

int

comet.kPublicationIconID = 19

int

comet.kPublicationValue1 = 20

str

comet.kPublicationValue2 = 21

str

comet.kPublicationValue3 = 22

str

comet.kPublicationIdentifier = 24

str

comet.kPublicationActionID = 25

str

comet.kPublicationDocumentID = 26

str

comet.kPublicationFieldCount = 27

int

comet.kPublicationBucketID = 28

str

comet.kPublicationBucketRefs = 29

list [str]

comet.kPublicationContextAssortment = 30

str

comet.kPublicationContextCountry = 31

str

comet.kPublicationContextLanguage = 32

str

comet.kPublicationContextWell = 33

str

comet.kPublicationContextMarket = 34

str

comet.kPublicationContextTargetGroup = 35

str

comet.kPublicationContextPublication = 36

str

comet.kPublicationContextDocumentID = 37

str

comet.kPublicationCordRefs = 38

list [str]

comet.kPublicationCreatedBy = 39

str

comet.kPublicationCreatedOn = 40

str

comet.kPublicationDeleted = 41

bool

comet.kPublicationDpTemplateID = 42

str

comet.kPublicationEntityBucketID = 43

str

comet.kPublicationEntityModelID = 44

str

comet.kPublicationEntityPlanningID = 45

str

comet.kPublicationImportID = 48

int

comet.kPublicationKeyValueRefs = 49

list [str]

comet.kPublicationChildren = 51

list [str]

comet.kPublicationMediaAssetRefs = 52

list [str]

comet.kPublicationMetaData = 53

list [str]

comet.kPublicationOrigin = 54

str

comet.kPublicationPageID = 55

str

comet.kPublicationPageTemplateElementID = 56

int

comet.kPublicationPageTemplateID = 57

int

comet.kPublicationParentPlanningID = 58

str

comet.kPublicationPriceRefs = 59

list [str]

comet.kPublicationPrintTemplateID = 60

int

comet.kPublicationSequence = 61

int

comet.kPublicationTableDataRefs = 62

list [str]

comet.kPublicationTextRefs = 63

list [str]

comet.kPublicationTimestamp = 64

str

comet.kPublicationUpdatedBy = 65

str

comet.kPublicationUpdatedOn = 66

str

comet.kPublicationUsePrintPageTemplate = 67

bool

comet.kPublicationVersion = 68

str

comet.kPublicationXPosBottomRight = 69

float

comet.kPublicationXPosTopLeft = 70

float

comet.kPublicationYPosBottomRight = 71

float

comet.kPublicationYPosTopLeft = 72

float

Document close modes

Used with CDocument.close()

comet.kDocCloseProcess = 0
comet.kDocCloseSchedule = 1
comet.kDocCloseImmediate = 2
kDocCloseModes
{ 0: 'kDocCloseProcess',
  1: 'kDocCloseSchedule',
  2: 'kDocCloseImmediate'}

Color models

comet.kColorModelUnknown = 0

Invalid model

comet.kColorModelGray = 1

Monochrome

comet.kColorModelRGB = 2

RGB

comet.kColorModelCMYK = 3

CMYK

comet.kColorModelLAB = 4

LAB

kColorModels
{ 0: 'kColorModelUnknown',
  1: 'kColorModelGray',
  2: 'kColorModelRGB',
  3: 'kColorModelCMYK',
  4: 'kColorModelLAB'}

Line types

comet.kLineTypeRow = 0

Rows

comet.kLineTypeColumn = 1

Columns

kLineTypes
{0: 'kLineTypeRow', 1: 'kLineTypeColumn'}

Row types

comet.kRowTypeAll = 0

All rows

comet.kRowTypeHeader = 1

Header rows

comet.kRowTypeBody = 2

Body rows

comet.kRowTypeFooter = 3

Footer rows

kRowTypes
{ 0: 'kRowTypeAll',
  1: 'kRowTypeHeader',
  2: 'kRowTypeBody',
  3: 'kRowTypeFooter'}

Stroke selectors

comet.kStrokeSideNone = 0
comet.kStrokeSideLeft = 1
comet.kStrokeSideTop = 2
comet.kStrokeSideRight = 4
comet.kStrokeSideBottom = 8
comet.kStrokeSideInteriorRows = 16
comet.kStrokeSideInteriorColumns = 32
comet.kStrokeSideAll = 63
kStrokeSelectors
{ 0: 'kStrokeSideNone',
  1: 'kStrokeSideLeft',
  2: 'kStrokeSideTop',
  4: 'kStrokeSideRight',
  8: 'kStrokeSideBottom',
  16: 'kStrokeSideInteriorRows',
  32: 'kStrokeSideInteriorColumns',
  63: 'kStrokeSideAll'}

Stroke attributes

comet.kStrokeAttrNone = 0
comet.kStrokeAttrWeight = 1
comet.kStrokeAttrColor = 2
comet.kStrokeAttrStrokeType = 4
comet.kStrokeAttrTint = 8
comet.kStrokeAttrOverprint = 16
comet.kStrokeAttrGapColor = 32
comet.kStrokeAttrGapTint = 64
comet.kStrokeAttrGapOverprint = 128
comet.kStrokeAttrAll = 255
comet.kStrokeAttrRGBColor = 256
comet.kStrokeAttrGapRGBColor = 257
kStrokeAttributes
{ 0: 'kStrokeAttrNone',
  1: 'kStrokeAttrWeight',
  2: 'kStrokeAttrColor',
  4: 'kStrokeAttrStrokeType',
  8: 'kStrokeAttrTint',
  16: 'kStrokeAttrOverprint',
  32: 'kStrokeAttrGapColor',
  64: 'kStrokeAttrGapTint',
  128: 'kStrokeAttrGapOverprint',
  255: 'kStrokeAttrAll',
  256: 'kStrokeAttrRGBColor',
  257: 'kStrokeAttrGapRGBColor'}

Stroke types

comet.kStrokeTypeNone = -1
comet.kStrokeTypeSolid = 0
comet.kStrokeTypeDashed = 1
comet.kStrokeTypeDash4X4 = 2
comet.kStrokeTypeDash3X2 = 3
comet.kStrokeTypeDots = 4
comet.kStrokeTypeWavy = 5
comet.kStrokeTypeStraightHash = 6
comet.kStrokeTypeRightSlant = 7
comet.kStrokeTypeLeftSlant = 8
comet.kStrokeTypeDiamond = 9
comet.kStrokeTypeJapaneseDots = 10
comet.kStrokeTypeThinThin = 11
comet.kStrokeTypeThinThick = 12
comet.kStrokeTypeThickThin = 13
comet.kStrokeTypeThickThick = 14
comet.kStrokeTypeThinThickThin = 15
comet.kStrokeTypeThickThinThick = 16
comet.kStrokeTypeTriple = 17
comet.kStrokeTypeTableStrip = 18
kStrokeTypes
{ -1: 'kStrokeTypeNone',
  0: 'kStrokeTypeSolid',
  1: 'kStrokeTypeDashed',
  2: 'kStrokeTypeDash4X4',
  3: 'kStrokeTypeDash3X2',
  4: 'kStrokeTypeDots',
  5: 'kStrokeTypeWavy',
  6: 'kStrokeTypeStraightHash',
  7: 'kStrokeTypeRightSlant',
  8: 'kStrokeTypeLeftSlant',
  9: 'kStrokeTypeDiamond',
  10: 'kStrokeTypeJapaneseDots',
  11: 'kStrokeTypeThinThin',
  12: 'kStrokeTypeThinThick',
  13: 'kStrokeTypeThickThin',
  14: 'kStrokeTypeThickThick',
  15: 'kStrokeTypeThinThickThin',
  16: 'kStrokeTypeThickThinThick',
  17: 'kStrokeTypeTriple',
  18: 'kStrokeTypeTableStrip'}

Product selectors

comet.kProductID = 1

int

comet.kProductID2 = 2

int

comet.kProductID3 = 3

int

comet.kProductPageitemID = 4

int

comet.kProductDocID = 5

int

comet.kProductMasterpage = 6

str

comet.kProductGrid = 7

str

comet.kProductGridID = 8

int

comet.kProductElement = 9

str

comet.kProductElementID = 10

int

comet.kProductNeedsrequest = 11

int

comet.kProductDefined = 12

int

comet.kProductLevel = 13

int

comet.kProductSubstatement = 14

int

comet.kProductClassID = 15

int

comet.kProductRow1 = 16

str

comet.kProductRow2 = 17

str

comet.kProductPreRuleID = 18

int

comet.kProductPreRuleparams = 19

str

comet.kProductPostRuleID = 20

int

comet.kProductPostRuleparams = 21

str

comet.kProductAdparams = 22

str

comet.kProductStringID = 23

str

comet.kProductSnippetAttr = 24

str

comet.kProductProductTextmodel = 25

Unused

comet.kProductProductStart = 26

int

comet.kProductProductEnd = 27

int

comet.kProductProductType = 28

int

comet.kProductProductLayer = 29

Unused

comet.kProductProductTagID1 = 30

int

comet.kProductProductTagID2 = 31

int

comet.kProductProductPageType = 32

int

comet.kProductProductOriginals = 33

Unused

comet.kProductProductUsedPageitem = 34

Unused

comet.kProductProductDocPosition = 37

int

comet.kProductProductToDelete = 38

int

kProductSelectors
{ 1: 'kProductID',
  2: 'kProductID2',
  3: 'kProductID3',
  4: 'kProductPageitemID',
  5: 'kProductDocID',
  6: 'kProductMasterpage',
  7: 'kProductGrid',
  8: 'kProductGridID',
  9: 'kProductElement',
  10: 'kProductElementID',
  11: 'kProductNeedsrequest',
  12: 'kProductDefined',
  13: 'kProductLevel',
  14: 'kProductSubstatement',
  15: 'kProductClassID',
  16: 'kProductRow1',
  17: 'kProductRow2',
  18: 'kProductPreRuleID',
  19: 'kProductPreRuleparams',
  20: 'kProductPostRuleID',
  21: 'kProductPostRuleparams',
  22: 'kProductAdparams',
  23: 'kProductStringID',
  24: 'kProductSnippetAttr',
  25: 'kProductProductTextmodel',
  26: 'kProductProductStart',
  27: 'kProductProductEnd',
  28: 'kProductProductType',
  29: 'kProductProductLayer',
  30: 'kProductProductTagID1',
  31: 'kProductProductTagID2',
  32: 'kProductProductPageType',
  33: 'kProductProductOriginals',
  34: 'kProductProductUsedPageitem',
  37: 'kProductProductDocPosition',
  38: 'kProductProductToDelete'}

Product build flags

comet.kUseDefaultGrid = 2
comet.kIgnoreIncompletePlacements = 4
comet.kAllowIncompletePlacements = 8
comet.kCheckIfNotExists = 16
comet.kShowErrors = 32
comet.kIntersectionsAllowed = 64
comet.kCheckGridElementSize = 128
comet.kUseFullPage = 256
comet.kDisableOptimizing = 512
comet.kPreferDefaultPageItem = 4096
comet.kSuppressAutoExtent = 8192
comet.kUseBleed = 524288
comet.kExpandGroups = 16384
comet.kAutoDetectType = 32768
comet.kInsertTextBeforeExceptFirst = 2097152
comet.kInsertTextAfterExceptLast = 4194304
comet.kShowProgress = 65536
comet.kSuppressShowErrors = 131072
comet.kAllowDoublers = 1048576
comet.kReloadAll = 4194304
comet.kSkipEmptyTemplates = 8388608
comet.kSuppressAlerts = 134217728
comet.kIgnoreErrors = 268435456
comet.kPreferExistingPages = 536870912
comet.kPreferProductPT = 1073741824
comet.kLoadMasterItems = 2147483648
kBuildFlags
{ 2: 'kUseDefaultGrid',
  4: 'kIgnoreIncompletePlacements',
  8: 'kAllowIncompletePlacements',
  16: 'kCheckIfNotExists',
  32: 'kShowErrors',
  64: 'kIntersectionsAllowed',
  128: 'kCheckGridElementSize',
  256: 'kUseFullPage',
  512: 'kDisableOptimizing',
  4096: 'kPreferDefaultPageItem',
  8192: 'kSuppressAutoExtent',
  524288: 'kUseBleed',
  16384: 'kExpandGroups',
  32768: 'kAutoDetectType',
  2097152: 'kInsertTextBeforeExceptFirst',
  4194304: 'kReloadAll',
  65536: 'kShowProgress',
  131072: 'kSuppressShowErrors',
  1048576: 'kAllowDoublers',
  8388608: 'kSkipEmptyTemplates',
  134217728: 'kSuppressAlerts',
  268435456: 'kIgnoreErrors',
  536870912: 'kPreferExistingPages',
  1073741824: 'kPreferProductPT',
  2147483648: 'kLoadMasterItems'}

Excel cell types

comet.kExcelCellTypeError = 0

Error

comet.kExcelCellTypeNumber = 1

Number (int or float)

comet.kExcelCellTypeText = 3

Text

comet.kExcelCellTypeBoolean = 4

Boolean

comet.kExcelCellTypeDateTime = 5

Datetime

comet.kExcelCellTypeBlank = 6

Blank, the cell contains only format information

comet.kExcelCellTypeEmpty = 7

Empty, the cell doesn’t exist

kExcelCellTypes
{ 0: 'kExcelCellTypeError',
  1: 'kExcelCellTypeNumber',
  3: 'kExcelCellTypeText',
  4: 'kExcelCellTypeBoolean',
  5: 'kExcelCellTypeDateTime',
  6: 'kExcelCellTypeBlank',
  7: 'kExcelCellTypeEmpty'}

Excel selectors

comet.kExcelBorderLeft = 0

Left border

comet.kExcelBorderTop = 1

Top border

comet.kExcelBorderRight = 2

Right border

comet.kExcelBorderBottom = 3

Bottom border

comet.kExcelBorderDiagonal = 4

Bottom border

comet.kExcelPatternForeground = 5

Foreground pattern

comet.kExcelPatternBackground = 6

Background pattern

kExcelSelectors
{ 0: 'kExcelBorderLeft',
  1: 'kExcelBorderTop',
  2: 'kExcelBorderRight',
  3: 'kExcelBorderBottom',
  4: 'kExcelBorderDiagonal',
  5: 'kExcelPatternForeground',
  6: 'kExcelPatternBackground'}

Excel border styles

comet.kExcelBorderStyleError = -1

Not set or error

comet.kExcelBorderStyleNone = 0

BORDERSTYLE_NONE

comet.kExcelBorderStyleThin = 1

BORDERSTYLE_THIN

comet.kExcelBorderStyleMedium = 2

BORDERSTYLE_MEDIUM

comet.kExcelBorderStyleDashed = 3

BORDERSTYLE_DASHED

comet.kExcelBorderStyleDotted = 4

BORDERSTYLE_DOTTED

comet.kExcelBorderStyleThick = 5

BORDERSTYLE_THICK

comet.kExcelBorderStyleDouble = 6

BORDERSTYLE_DOUBLE

comet.kExcelBorderStyleHair = 7

BORDERSTYLE_HAIR

comet.kExcelBorderStyleMediumDashed = 8

BORDERSTYLE_MEDIUMDASHED

comet.kExcelBorderStyleDashdot = 9

BORDERSTYLE_DASHDOT

comet.kExcelBorderStyleMediumDashdot = 10

BORDERSTYLE_MEDIUMDASHDOT

comet.kExcelBorderStyleDashDotDot = 11

BORDERSTYLE_DASHDOTDOT

comet.kExcelBorderStyleMediumDashDotDot = 12

BORDERSTYLE_MEDIUMDASHDOTDOT

comet.kExcelBorderStyleSlantDashDot = 13

BORDERSTYLE_SLANTDASHDOT

kExcelBorderStyles
{ -1: 'kExcelBorderStyleError',
  0: 'kExcelBorderStyleNone',
  1: 'kExcelBorderStyleThin',
  2: 'kExcelBorderStyleMedium',
  3: 'kExcelBorderStyleDashed',
  4: 'kExcelBorderStyleDotted',
  5: 'kExcelBorderStyleThick',
  6: 'kExcelBorderStyleDouble',
  7: 'kExcelBorderStyleHair',
  8: 'kExcelBorderStyleMediumDashed',
  9: 'kExcelBorderStyleDashdot',
  10: 'kExcelBorderStyleMediumDashdot',
  11: 'kExcelBorderStyleDashDotDot',
  12: 'kExcelBorderStyleMediumDashDotDot',
  13: 'kExcelBorderStyleSlantDashDot'}

Excel underline styles

comet.kExcelUnderlineNone = 0
comet.kExcelUnderlineSingleAbove = 1
comet.kExcelUnderlineDoubleAbove = 2
comet.kExcelUnderlineSingleBelow = 3
comet.kExcelUnderlineDoubleBelow = 4
kExcelUnderlineStyles
{ 0: 'kExcelUnderlineNone',
  1: 'kExcelUnderlineSingleAbove',
  2: 'kExcelUnderlineDoubleAbove',
  3: 'kExcelUnderlineSingleBelow',
  4: 'kExcelUnderlineDoubleBelow'}

Excel font positions

comet.kExcelPositionNormal = 1

Normal

comet.kExcelPositionSuper = 2

Superscript

comet.kExcelPositionSub = 3

Subscript

kExcelPositions
{ 1: 'kExcelPositionNormal',
  2: 'kExcelPositionSuper',
  3: 'kExcelPositionSub'}

Magnet situations

comet.kMagnetsNone = 0

No situation

comet.kMagnetsPlaceholder = 1

After placeholder loading

comet.kMagnetsScript = 2

Calls to frame::apply_magnets

comet.kMagnetsBuildProducts = 4

Product build and reorganization

comet.kMagnetsToDoList = 8

Updating using the ToDo list panel

comet.kMagnetsChangeTemplate = 16

Template change

comet.kMagnetsLayoutRule = 32

Layout rule ‘Update magnet distances’

comet.kMagnetsAll = 4294967295

All situations

kMagnetSituations
{ 0: 'kMagnetsNone',
  1: 'kMagnetsPlaceholder',
  2: 'kMagnetsScript',
  4: 'kMagnetsBuildProducts',
  8: 'kMagnetsToDoList',
  16: 'kMagnetsChangeTemplate',
  32: 'kMagnetsLayoutRule',
  4294967295: 'kMagnetsAll'}

Magnet states

comet.kMagnetsEnable = 1
comet.kMagnetsDisable = 0
comet.kMagnetsToggle = -1
kMagnetStates
{1: 'kMagnetsEnable', 0: 'kMagnetsDisable', -1: 'kMagnetsToggle'}

Swatch types

comet.kSwatchTypeNone = 0
comet.kSwatchTypeBaseColor = 1
comet.kSwatchTypeTintColor = 2
comet.kSwatchTypeMixedInkColor = 3
comet.kSwatchTypeLinkedMixedInkColor = 4
comet.kSwatchTypeMixedInkParent = 5
comet.kSwatchTypeGradient = 6
comet.kSwatchTypeBlackBoxPaint = 7
comet.kSwatchTypeOther = 8
kSwatchTypes
{ 0: 'kSwatchTypeNone',
  1: 'kSwatchTypeBaseColor',
  2: 'kSwatchTypeTintColor',
  3: 'kSwatchTypeMixedInkColor',
  4: 'kSwatchTypeLinkedMixedInkColor',
  5: 'kSwatchTypeMixedInkParent',
  6: 'kSwatchTypeGradient',
  7: 'kSwatchTypeBlackBoxPaint',
  8: 'kSwatchTypeOther'}

Swatch spaces

comet.kSwatchSpaceInvalid = 0
comet.kSwatchSpaceFromDisk = 1
comet.kSwatchSpaceEmbeddedInImage = 2
comet.kSwatchSpaceEmbeddedInDocument = 3
comet.kSwatchSpaceGray = 4
comet.kSwatchSpaceRGB = 5
comet.kSwatchSpaceCMYK = 6
comet.kSwatchSpaceLAB = 7
comet.kSwatchSpaceVirtual = 8
kSwatchSpaces
{ 0: 'kSwatchSpaceInvalid',
  1: 'kSwatchSpaceFromDisk',
  2: 'kSwatchSpaceEmbeddedInImage',
  3: 'kSwatchSpaceEmbeddedInDocument',
  4: 'kSwatchSpaceGray',
  5: 'kSwatchSpaceRGB',
  6: 'kSwatchSpaceCMYK',
  7: 'kSwatchSpaceLAB',
  8: 'kSwatchSpaceVirtual'}

Cell types

comet.kCellTypeText = 1

Text cell

comet.kCellTypeGraphic = 2

Graphic cell

kCellTypes
{1: 'kCellTypeText', 2: 'kCellTypeGraphic'}

Overprint settings

comet.kOverprintBasic = 0

All

comet.kOverprintStroke = 1

Stroke

comet.kOverprintFill = 2

Stroke

comet.kOverprintGap = 3

Gap of stroke

kOverprintSettings
{ 0: 'kOverprintBasic',
  1: 'kOverprintStroke',
  2: 'kOverprintFill',
  3: 'kOverprintGap'}

Snippet match settings

comet.kSnippetsNever = 0

No, don’t use snippets

comet.kSnippetMatchesProduct = 1

Yes, if products match

comet.kSnippetMatchesTemplate = 2

Yes, if templates match

comet.kSnippetMatchesDocument = 4

Yes, if documents match

comet.kSnippetMatchesStrict = 55
comet.kSnippetMatchesTolerant = 3
comet.kSnippetFallbackToTemplate = 8

If the snippet doesn’t fit the page element, use original template instead.

comet.kSnippetMatchesLayer = 16

Yes, if layers match

comet.kSnippetMatchesContext = 32

Yes, if the contexts match

comet.kSnippetMatchesExactly = 51
comet.kSnippetAcceptAnyMatch = 64
comet.kSnippetCreate = 128

Create non existing snippets on the fly

kSnippetMatching
{ 0: 'kSnippetsNever',
  1: 'kSnippetMatchesProduct',
  2: 'kSnippetMatchesTemplate',
  4: 'kSnippetMatchesDocument',
  55: 'kSnippetMatchesStrict',
  3: 'kSnippetMatchesTolerant',
  8: 'kSnippetFallbackToTemplate',
  16: 'kSnippetMatchesLayer',
  32: 'kSnippetMatchesContext',
  51: 'kSnippetMatchesExactly',
  64: 'kSnippetAcceptAnyMatch',
  128: 'kSnippetCreate'}

Page info

comet.kPageInfoActivated = 1

bool

Active?

comet.kPageInfoID = 2

int

ID of the page template. When setting this attribute, the correct page template for the page type is used

comet.kPageInfoIDs = 1021

int

When changing the template for one page, all subsequent pages of the document will be changed according to the settings in the template.

Otherwise like kPageInfoID.

comet.kPageInfoName = 3

str

Name of the page template.

comet.kPageInfoPageType = 4

int

Page type of the page template.

  • 0: Unisex

  • 1: Left

  • 2: Right

comet.kPageInfoBarrierType = 5

int

ID of after apply script

comet.kPageInfoSuccessorID = 6

int

comet.kPageInfoMasterpages = 7

list[str]

comet.kPageInfoAutoOpposite = 8

bool

comet.kPageInfoAutoSuccessor = 9

bool

comet.kPageInfoOppositeID = 10

int

comet.kPageInfoDocu = 11

str

comet.kPageInfoDirection = 12

int

comet.kPageInfoOrigin = 13

int

UID of the page in the master document.

The information is only required in Master-Variant Syncs.

comet.kPageInfoBkLayers = 1022

list[str]

kPageInfo
{ 1: 'kPageInfoActivated',
  2: 'kPageInfoID',
  1021: 'kPageInfoIDs',
  3: 'kPageInfoName',
  4: 'kPageInfoPageType',
  5: 'kPageInfoBarrierType',
  6: 'kPageInfoSuccessorID',
  7: 'kPageInfoMasterpages',
  8: 'kPageInfoAutoOpposite',
  9: 'kPageInfoAutoSuccessor',
  10: 'kPageInfoOppositeID',
  11: 'kPageInfoDocu',
  12: 'kPageInfoDirection',
  13: 'kPageInfoOrigin',
  1022: 'kPageInfoBkLayers'}

Horizontal Justification

comet.kJustifyLeft = 0

Justify left

comet.kJustifyRight = 1

Justify right

comet.kJustifyCenter = 2

Justify center

comet.kJustifyFullLastLineLeft = 3

Justify full, last line left

comet.kJustifyFullLastLineRight = 4

Justify full, last line right

comet.kJustifyFullLastLineCenter = 5

Justify full, last line center

comet.kJustifyFullLastLineFull = 6

Justify full, last line full

kHorizontalJustification
{ 0: 'kJustifyLeft',
  1: 'kJustifyRight',
  2: 'kJustifyCenter',
  3: 'kJustifyFullLastLineLeft',
  4: 'kJustifyFullLastLineRight',
  5: 'kJustifyFullLastLineCenter',
  6: 'kJustifyFullLastLineFull'}

Table column compression

comet.kBroadenFirstLast = 1

Shrink columns to their minimum before rebuilding table, broaden columns to fit the text frame after rebuilding

comet.kBroadenFirst = 0

Shrink columns to their minimum before rebuilding table

comet.kBroadenLast = 2

Broaden columns to fit the text frame after rebuilding

comet.kBroadenNever = 3

Leave the column widths untouched

kTableColumnCompression
{ 1: 'kBroadenFirstLast',
  0: 'kBroadenFirst',
  2: 'kBroadenLast',
  3: 'kBroadenNever'}