4 Replies Latest reply on Jan 23, 2010 11:28 PM by Harbs.

    How to embed Script into InDesign file?

    fettergroup

      I have an indesign script that another member graciously put together; however, I am not sure how to utilize it in the InDesign file.  Can someone point me to a tutorial or give me some guidance on how I put this script into the InDesign file?  Thanks!!

       

       

      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();

                  }

              }

          }