4 Replies Latest reply on Mar 14, 2016 7:29 AM by Jump_Over

    Find pagebreak and parent textframe

    Jaswin Level 1

      Here is my code, where i get error while finding content and I need the parent text frame of "PageBreak"?

       

      var doc=app.activeDocument;

      var Frame = doc.allPageItems;

      var plength=doc.pages.length;

      for(var i=0;i<Frame.length;i++) 

         if(Frame[i] instanceof TextFrame) 

           {   

             app.findGrepPreferences = app.changeGrepPreferences =NothingEnum.nothing; 

             app.findGrepPreferences.findWhat = "~P"; 

             var found = Frame[i].findGrep();

             $.writeln(found.length)

                          if(found.length > 0) 

                          {

                              if(Frame[i].contents>10)

                              {

                              //some function

                              }

                           } 

                      }   

              } 

       

      Can anyone help on this?