Script is... too fast?
Hi,
Is that possible, that script do things faster then InDesign can react, so some codes return false results?
For example this situation:
There is a 1 row 4 columns table with contents. All of those cell's default width is equal ( = table.width/4).
So I want to fit those width to the contents and run this...
-----------------
table.cells.everyItem().width = 5;
for (var u = 0; u < table.cells.length ; u++)
{
while (table.cells.overflows){
table.cells.width++;
}
}
------------------
It works fine as a separate code.
But as a part of longer one (this is a function called from main body)
goes to recursive job: cell is growing, cause cells.overflows keeps value = true unless cells width gone to "tousend of points".
Is cells.overflows value (true or false) depend on InDesign display abilities?
---------------------
edited later...
If I replace while conditions to:
for (var u = 0; u < table.cells.length ; u++)
{
while (table.cells.contents !== table.cells.paragraphs[0].contents)
table.cells.width++;
}
it works fine in both ways.
thx