4 Replies Latest reply on Oct 27, 2014 3:19 AM by Murali_Vetha

    Smart Text Reflow not working

    Murali_Vetha Level 1

      Hi,

       

      When I flow doc file to indesign smart text reflow not working properly. Please see my below codings.

       

      -----------------------

      var myIndFile = File.openDialog ("Select Indesign File");

      var myWordFile = File.openDialog ("Select Word File");

       

      var myWordFileName = myWordFile.name;

      var myIndFilePath = myIndFile.filePath;

       

      app.open (myIndFile);

       

      var mydoc = app.activeDocument;

       

      mydoc.pages.item(0).textFrames.item(0).place(File(myWordFile));

       

      mydoc.textPreferences.smartTextReflow = true;

      mydoc.textPreferences.limitToMasterTextFrames = true;

      mydoc.textPreferences.deleteEmptyPages = true;

      //~ mydoc.textPreferences.addPagesTo = AddPageOptions.END_OF_STORY();

       

       

      //~ app.activeDocument.save(File("myIndFilePath" + "/" + "myWordFileName"));

       

       

      Regards,

      Vetha

        • 1. Re: Smart Text Reflow not working
          Sajeev Sridharan Level 4

          Hi,

           

          Smart text reflow need at least two text frames are threaded together, make sure the first page textframe is linked to the second page textframe (see below image for reference), then run the below script and wait for 1 or two seconds, then it will work.


          page.png

          var myIndFile = File.openDialog ("Select Indesign File");
          var myWordFile = File.openDialog ("Select Word File");
          var myWordFileName = myWordFile.name;
          var myIndFilePath = myIndFile.filePath;
          app.open (myIndFile);
          var mydoc = app.activeDocument;
          mydoc.pages.item(0).textFrames.item(0).place(File(myWordFile));
          mydoc.textPreferences.smartTextReflow = true;
          mydoc.textPreferences.limitToMasterTextFrames = false;
          mydoc.textPreferences.deleteEmptyPages = true;
          



          Vandy

          • 2. Re: Smart Text Reflow not working
            Murali_Vetha Level 1

            Hi Vandy,

             

            I have already tried, it will work. but I expect how to run in a single page. OK anyway thanks for your reply

             

            Thank you so much.

             

            Regards,

            Vetha

            • 3. Re: Re: Smart Text Reflow not working
              Trevorׅ Adobe Community Professional

              This is the sort of thing you could do.

               

              //https://forums.adobe.com/thread/1579131
              var myWordFile = File.openDialog ("Select Word File");
              !myWordFile && exit();
              var doc = app.activeDocument,
                  placePage = doc.pages[0],
                  placeFrame = placePage.textFrames[0],
                  newPage, newFrame, pageProperties, frameProperties;
              
              placeFrame.place(File(myWordFile));
              if (placeFrame.overflows) {
                  pageProperties = placePage.properties;
                  frameProperties = placeFrame.properties;
                  newPage = doc.pages.add(pageProperties);
                  newFrame = newPage.textFrames.add(frameProperties);
                  placeFrame.nextTextFrame = null;
                  newFrame.previousTextFrame = placeFrame;
              }
              doc.textPreferences.smartTextReflow = true;
              doc.textPreferences.limitToMasterTextFrames = false;
              doc.textPreferences.deleteEmptyPages = true;
              
              • 4. Re: Re: Smart Text Reflow not working
                Murali_Vetha Level 1

                Hi Trevor,

                 

                Excellent Answer, Sorry for delay reply, because at the time of I ask questions to you and others, I don't know how to use forum. Anyway Thanks a lot.

                 

                Fine to work your script.

                 

                Regards,

                Vetha