[Indesign CC 2018][BUG] Offset tables not detected when running Javascript
When running a script which processes tables in textframes, offset tables are not detected. If you have a text frame which contains 5 tables, of which are only 3 visible, and 2 are offset. The script detects only 3. You can test this using ...
alert(app.activeDocument.allPageItems[0].tables.length);

-
Uwe Laubender commented
I think, that's no bug. But I'm not sure…
Provided your allPageItems[0] contains a text frame and that text frame is showing overset and therefore is showing only 3 out of 5 tables, then the tables.length value is only 3.If you are asking differently:
app.documents[0].allPageItems[0].parentStory.tables.length
you'd get 5 as result.Also:
app.documents[0].stories[0].tables.length
if your tables are created with that story.Regards;
Uwe