2 Replies Latest reply on Feb 18, 2010 3:04 AM by gopaljay78

    Add page at end and link overflow text frame to last page

    gopaljay78 Level 1

      Hi,


      I am writing a script to find if there is overflow text iin the selected text frame.

      If it is overflowed, I need to add a page at end. This page should applied specific master page and the master page itself have text frames.


      What I actually want is, the overflow text should be flown to the newly added page.


      I wrote a simple script for doing this task. But the problem is, when the text is flown to new page, I am unable to select the text frame that is already present in that page (the text frame is already in master page). Because of this, the text is not flown to the new page.


      My script is:


      if (app.selection[0].overflows == true)  { 

          var pe = app.activeDocument.pages.add();

          var nextTextframe1 = mylastPage.masterPageItems[1];

          app.selection[0].nextTextFrame= nextTextframe1;

      }

      else  {

          alert ("Not Overflows");

      }


      Please suggest the solution for this.


      Regards,

      Gopal