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?

#56859

(Achh! Reply was to previous replay ;))

Yes, I suspect writing it as one single AS command allows you to Undo it at once. However, Me ≠ AppleScript.

There is also a way to encapsulate an entire Javascript into one “undo” command — hold on while I look up how that was done.

(.. insert elevator muzak here ..)

There we go:

cellStyleName = “myCellStyle”;
newHeight = “12mm”;

app.doScript (sizeRows, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.FAST_ENTIRE_SCRIPT, 'Undo Resize Height of “'+cellStyleName+'”');

function sizeRows ()
{
cellarray = app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().getElements();
for (a=0; a<cellarray.length; a++)
if (cellarray[a].appliedCellStyle.name == cellStyleName)
cellarray[a].height = newHeight;
}

This article was last modified on August 28, 2010

Comments (0)

Loading comments...