1 Reply Latest reply on Apr 28, 2015 3:22 PM by TᴀW

    text autoflow

    creativejoan0425 Level 1

      I have a document page 1 have overflow text, if I need to flow all text content, it should need 10 pages to flow, I try to use the script to flow all text content in a new page , but can;t autoflow, only add 1 page, how can I autoflow the remain content?

      var myDoc = app.activeDocument;

      var myFrames = myDoc.textFrames;

      while (myFrames[0].overflows === true) {

          var myNewPage = myDoc.pages.add();

          var myMargin = myNewPage.marginPreferences;

          var myBounds = [myMargin.top, myMargin.left, myDoc.documentPreferences.pageHeight - myMargin.bottom, myDoc.documentPreferences.pageWidth - myMargin.right];

          var myOldRuler = myDoc.viewPreferences.rulerOrigin;

          myDoc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;

          with(myDoc.pages[-1].textFrames.add()) {

              geometricBounds = myBounds;

              previousTextFrame = myDoc.pages[-2].textFrames[0];

              }

          myDoc.viewPreferences.rulerOrigin = myOldRuler;

          }