• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Script to extract column from a table and paste it as a text frame

Explorer ,
May 11, 2018 May 11, 2018

Copy link to clipboard

Copied

Hi, everybody!
I wonder if there's a way —or maybe there's a script that already exist— to convert all columns from all tables in a document to individuals text frames with the same high and widh lenght that had as table columns and preserving the same paragraph style from each cell.

TOPICS
Scripting

Views

541

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 11, 2018 May 11, 2018

Copy link to clipboard

Copied

Hi,

The following sample script demonstrates getting the information you want from a table.

set colInfo to {}

tell application "Adobe InDesign CC 2018"

  set tableRef to table 1 of story 1 of document 1

  set colList to columns of tableRef

  repeat with i from 1 to length of colList

  set thisCol to item i of colList

  set celList to cells of thisCol

  set wid to width of thisCol

  set totHgt to 0

  set celInfo to {}

  repeat with j from 1 to length of celList

  set thisCel to item j of celList

  set c to contents of contents of thisCel

  set s to applied paragraph style of paragraph 1 of thisCel

  set h to height of thisCel

  set end of celInfo to {c, s}

  set totHgt to totHgt + h

  end repeat

  set end of colInfo to {celInfo, wid, totHgt}

  end repeat

This creates a nested list of lists that you can then parse to create your text frames with contents and styling. Hope this helps.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 12, 2018 May 12, 2018

Copy link to clipboard

Copied

LATEST

Just by curiosity! … For what use?

Best,

Michel, from FRIdNGE

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines