Table paragraph split and move
Hi All,
I hope it can doable in script. But am struck from a point.
Requirement:
If a table cell contains more than one line then we need to insert the rows and move the content
Logic used:
1) Count the line in each cell
2) If it contains more than one line then add the rows before
3) move the contents

Tried coding (Code got from forum, thanks to Chinna):
var doc = app.activeDocument,
_tables = doc.stories.everyItem().textStyleRanges.everyItem().getElements(),
i, j, k, l, _columns, _cells, tempVar = "", page;
for (i = 0; i < _tables.length; i++)
{
for (j = 0; j < _tables.tables.length; j++)
{
tempVar += "\r";
_columns = _tables.tables
.columns; for (k = 0; k < _columns.length; k++)
{
_cells = _columns
.cells; tempVar += "\r";
for (l = 0; l < _cells.length; l++)
{
if(_cells
.paragraphs.length>1){ alert(_cells[1].contents)
//~ tempVar += _cells
.paragraphs + "\t"; //Copy contents from table cell to a temporary variable _cells
.rows.add( LocationOptions.BEFORE, _cells .rows[0] );
}
}
}
}
}
Thanks,
K
