2 Replies Latest reply on Oct 22, 2015 9:50 PM by sreekarthik.k@gmail.com

    Break Text Frame

    Level 1

      I need to break the textframe ans place the overset text in to new page. Script label name for text frame Abstract

      Capture.PNG

      Is this possible via scripting. I have attached the screenshot for reference.

        • 1. Re: Break Text Frame
          BSKTCreation Level 2

          Here is a script I wrote a few years ago, it still works in CC.

           

          TextToNewPage();
          
          
          function TextToNewPage() {
              var myFrames = app.activeDocument.textFrames;
              for (var j = 0; j < myFrames.length; j++) {
                  while (myFrames[j].overflows == true) {
                      var np = app.activeDocument.pages.add();
                      var marg = np.marginPreferences;
                      var gb = [marg.top, marg.left, app.activeDocument.documentPreferences.pageHeight - marg.bottom, app.activeDocument.documentPreferences.pageWidth - marg.right];
                      var oldRuler = app.activeDocument.viewPreferences.rulerOrigin;
                      app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
                      with(app.activeDocument.pages[-1].textFrames.add()) {
                          geometricBounds = gb;
                          previousTextFrame = app.activeDocument.pages[-2].textFrames[0];
                          }
                      app.activeDocument.viewPreferences.rulerOrigin = oldRuler;
                      }
                  }
              }
          
          
          
          

           

          Brett

          • 2. Re: Break Text Frame
            Level 1

            Thank you so much.