Skip navigation
Currently Being Moderated

Smart text flow doesn't work in scripting

Jun 23, 2011 1:40 PM

This is getting to be really frusting. I have enabled smart text flow, it only works if I open the app and modify a textframe. It never works when I run it through a script????? How do I activate this stupid feature using a script?

 
Replies
  • Currently Being Moderated
    Jul 4, 2011 12:36 AM   in reply to xmlapi

    Hi,

     

    This works (for me):

     

    var document = app.activeDocument;
    var textFrame = document.textFrames.add();
    var page = document.pages.add();
    var nextTextFrame = page.textFrames.add();

     

    document.textPreferences.smartTextReflow = true;
    document.textPreferences.limitToMasterTextFrames = false;
    document.textPreferences.deleteEmptyPages = true;
    document.textPreferences.addPages = AddPageOptions.END_OF_DOCUMENT;

     

    textFrame.geometricBounds = [10, 10, 280, 200];
    nextTextFrame.geometricBounds = [10, 10, 280, 200];
    nextTextFrame.previousTextFrame = textFrame;

     

    for(var index = 0; index < 100; index++)
    {
        textFrame.contents += "Hello InDesign World Hello InDesign World Hello InDesign World Hello InDesign World Hello InDesign World Hello InDesign World Hello InDesign World ";
    }

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 4, 2011 1:38 AM   in reply to xmlapi

    Why do you want to activate it if it's so stupid?

     

    Peter

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 7, 2011 12:07 AM   in reply to xmlapi

    I think you're missing the point. You should not add pages in the loop. The smart text reflow does the adding for you (when there is text overflow).

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points