How can I use a script to determine if the last row of a table is really empty?
Last time Peter Kahrel said that the empty row judgment will fail if the table overflows without displaying.
It does happen when I test it, any ideas?
The code below, I originally intended to add an empty row as the end of the table if there is no end of the table.
Now there is a problem.
Sometimes the end of the table already exists, but after running the script, it will still incorrectly add a blank line.
Sometimes the last row is not a blank row, but after running the script, the row with content is turned into the end of the table.
var cell = app.activeDocument.selection[0].parent;
var myTable = cell.parent;
if( myTable.rows[-1].cells.everyItem().contents!==""||myTable.rows[-1].rowTypes!==RowTypes.FOOTER_ROW){
dupeLastRow(myTable);
}
function dupeLastRow(p){
myTable.rows.add(LocationOptions.AFTER, myTable.rows[-1]);
}
myFooterRow = myTable.rows[-1];

