1 Reply Latest reply on Jan 8, 2015 3:22 PM by Bill McLean

    Adding pages and Text Frames to emulate the behaviour of "Smart Text Reflow"

    Bill McLean

      I am creating a large number of tables in a document.  If I have Smart Text reflow turned on, my script does not work properly.  I have the start of the processing:

       

      1. Add a new table

      2. If the last page text frame overflows then Add a new page

       

      With smartTextReflow turned off, I want to ensure that new text frames that match the primary text frames from the master page.  It has to be able to handle getting the parameters from the left/right page text frame.

        • 1. Re: Adding pages and Text Frames to emulate the behaviour of "Smart Text Reflow"
          Bill McLean Level 1

          I have been able to solve my problem.  I was really overthinking things!!!

           

          Since I have designated the text frames on the master pages as primary text frames, when creating a new page, a text frame is created automatically. So the problem is then just link the previous text frame to the text frame that was created when adding the page.

           

          TableAutomation.prototype.AddPage = function() {

               var previousTextFrame = app.activeDocument.pages[-2].textFrames[0];

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

               var textFrame = np.textFrames[0];

               previousTextFrame.nextTextFrame = textFrame;

          };

          The cost of the above code was about 5 hours of banging my head against the wall