comet.table

This module provides factory functions for accessing and creating tables in a document.

See also

Class comet.CTable

Accessor for tables in a document

Methods

comet.table.create(frame, columnCount, rowCount, insertPoint=0, deleteRange=-1, cellHeight=20.0, cellWidth=30.0, headerRowCount=0, footerRowCount=0)

Create a new table

Illustrator® Since tables are not inside text frames, the table is placed at the top left corner of the current artboard.

Parameters:
  • frame (CFrame) –

    The frame to create the table inside

    Illustrator® Ignored - pass None

  • columnCount (int) – Number of table columns (at least 1)

  • rowCount (int) – Number of table rows (at least 1)

  • insertPoint (int) –

    The text index where to insert the table

    Illustrator® Ignored - pass 0

  • deleteRange (int) –

    The number of characters to delete.

    Default is constants.kEnd == until the text end

    Illustrator® Ignored - pass 0

  • cellHeight (float) – Height of the cells. Must be >= 4.0

  • cellWidth (float) – Width of the cells. Must be >= 4.0

  • headerRowCount (int) – Number of header rows. Must be >= 0

  • footerRowCount (int) – Number of footer rows. Must be >= 0

Returns:

The new table on success

Return type:

CTable

Raises:
  • TypeError – When parameter types are invalid

  • ValueError – When parameter rows, columns or insertPoint is invalid

  • CometError – When table could not be created

Available:

InDesign® comet_pdf® Illustrator®

CScript:

table::create

comet.table.find(document=None, pages=[], frames=[])

Find tables in the document

Parameters:
  • document (CDocument) –

    The document to search in.

    • None: Script document

  • pages (list[int]) –

    Restrict search to these pages (0 based)

    • Empty list: Impose no restriction

  • frames (list[CFrame]) –

    Restrict search to these frames

    • Empty list: Impose no restriction

Returns:

The found tables

Return type:

list[CTable]

Raises:
  • TypeError – When parameter types are invalid

  • ValueError – When parameter frames or pages contain invalid types

  • CometError – On internal error

Available:

InDesign® comet_pdf® Illustrator®