Reply To: Define table row heights, column widths in styles somehow?

Home Page / Forums / General InDesign Topics (CLOSED) / Define table row heights, column widths in styles somehow? / Reply To: Define table row heights, column widths in styles somehow?

#56855

Javascript is missing a construct that is available in Applescript: the whose command. whose selects from an array only the elements that have a certain value. Since you don't want to apply your change to every cell, which is what everyItem selects, you'll have to get 'everything', then loop over the result, applying your height only to cells with the right name.

This seems to work (since it's no longer a single command, Undo undoes it one at a time):

cellarray = app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().getElements();
for (a=0; a<cellarray.length; a++)
if (cellarray[a].appliedCellStyle.name == “myCellStyle”) // <- Cell Style Name!
cellarray[a].height = “12mm”;

This article was last modified on August 28, 2010

Comments (0)

Loading comments...