No worries. Will admit that I had not written a try/catch wrapper before, but was pretty easy. I've adjusted that part of the script to now look like this:
try { var inlines = myDocument.stories.everyItem().pageItems.everyItem().getElements(); while(fr=inlines.pop()){ if(fr instanceof Group){continue} if(fr instanceof TextFrame){ if(fr.contents == "" && fr.strokeWeight == "0" && fr.fillColor.name == "None" && fr.textWrapPreferences.textWrapMode === TextWrapModes.NONE && fr.textPaths.length == 0){fr.remove()} continue; } if(fr.graphics.length==0 && fr.strokeWeight == "0" && fr.fillColor.name == "None" && fr.textWrapPreferences.textWrapMode === TextWrapModes.NONE && fr.textPaths.length == 0){fr.remove()} } } catch(err) { alert("There are no text boxes in this document"); }
Just out of curiosity, has anyone else experienced issues or errors with the script?
Colin