• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

fit column with longest word text Indesign script

New Here ,
Feb 06, 2017 Feb 06, 2017

Copy link to clipboard

Copied

I am looking for an Indesign 2017 script that it will fit the table column with longest word in the column for multiple tables

any body can  help me with that

Thanks

TOPICS
Scripting

Views

653

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
Contributor ,
Jul 11, 2018 Jul 11, 2018

Copy link to clipboard

Copied

Hey you can try this,

var myDoc = app.documents[0];

var cellWidth = "";

var myTable = myDoc.pages[0].textFrames[0].tables[0];

for(var i = 0; i < myTable.cells.length; i++){

    if(i == 0){

        var l = myTable.cells.words.length;

        }

    else if(myTable.cells.words.length > l){

        cellWidth = myTable.cells.width;

        l = myTable.cells.words.length;

        }

    }

myTable.cells.everyItem().width = cellWidth;

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
Community Expert ,
Jul 11, 2018 Jul 11, 2018

Copy link to clipboard

Copied

Hi payalm68947498 ,

did you test your code?

Regards,
Uwe

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
Contributor ,
Jul 11, 2018 Jul 11, 2018

Copy link to clipboard

Copied

LATEST

Yes....

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