Answered
Thanks!
This topic has been closed for replies.
hi @lauras86935790,
Try the following, the original code seems to have been corrupted when forum software was migrated
var myDocument = app.activeDocument;
for(var i=myDocument.textFrames.length-1; i>=0; i--){
for(var j=myDocument.textFrames[i].tables.length-1; j>=0; j--){
for(var k=myDocument.textFrames[i].tables[j].rows.length-1; k>=0; k--){
myContents = 0;
for(var l=myDocument.textFrames[i].tables[j].rows[k].cells.length-1; l>=0; l--){
if (myDocument.textFrames[i].tables[j].rows[k].cells[l].contents != "") myContents++;
}
if (myContents == 0) myDocument.textFrames[i].tables[j].rows[k].remove();
}
}
}
-Manan
You could even try a shorter script like the following
var rows = app.activeDocument.textFrames.everyItem().tables.everyItem().rows.everyItem().getElements()
for(var i = rows.length - 1; i >= 0; i--)
{
if(rows[i].cells.everyItem().contents.toString().replace(/,/g, "") == "")
rows[i].remove()
}
-Manan
Sign up
Already have an account? Login
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inSign in to Adobe Community
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
