Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 82585

Re: Re: cleaning up text frames

$
0
0

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


Viewing all articles
Browse latest Browse all 82585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>