9 Replies Latest reply on Nov 28, 2011 6:08 AM by Selva_TRM

    error in Java script "undefined is not an object"

    Selva_TRM

      Dear All,

       

      Im using InDesign CS4. Im trying to remove the anchor frames containing some text. but i got the error msg "undefined is not an object". Here is my part code.

       

      app.findGrepPreferences.findWhat = "AQ\\d+";

      myFoundItems=app.findGrep();

      var myLen=myFoundItems.length;

      for(var i=myLen-1; i>=0;i--){

          alert(myFoundItems[i].contents);

          var a = app.select(myFoundItems[i].parentTextFrames);

          a.remove();

          }

       

       

       

      Please help anyone.

       

       

      Thanks

      Selva