1 Reply Latest reply on Jul 29, 2010 12:37 PM by Muppet Mark-QAl63s

    empty text boxes

    tlotzer1000

      I get a lot of files from customers that contain empty text boxes. I need to find a way to convert ALL empty text boxes to null or Picture. Selecting everything on the page, then converting to graphic or null does not work. You have to find and convert them all one by one. Any scripts out there?

       

        • 1. Re: empty text boxes
          Muppet Mark-QAl63s Level 4

          Im taking a guess that your text frames are rectangles that have accidently been clicked inside with the text tool? This may be a starting point although I think its going to require more tests for inline graphics etc.

           

          function main() {
               if (app.documents.length == 0) {
                    alert("Please have an 'Indesign' document before running this script.");
                    return;
               }
               app.activate();
               var docRef = app.activeDocument;
               with (docRef) {
                    for (var i = 0; i < textFrames.length; i++) {
                         if (textFrames[i].characters.length == 0) {
                              textFrames[i].contentType = ContentType.unassigned;
                         }
                    }          
               }     
          }
          
          main();