Skip to main content
Known Participant
August 12, 2009
Question

Autoflow a story

  • August 12, 2009
  • 1 reply
  • 5342 views

How do you autoflow a story created in the story editor that will fill several pages? In PageMaker scripting it was as simple as closing the story editor and placing the story at position X,Y with Autoflow selected. You did not have to create the text fame first.

I am not asking anyone to write the code. I need a conceptual explanation.

I did find this thread:

http://forums.adobe.com/message/1112323#1112323

Does InDesign CS4 still have this limitation? It's surprising to find this feature missing.

This topic has been closed for replies.

1 reply

Steven__
Inspiring
August 12, 2009

Here's some javascript code that I use.

copy into file with .jsx extension and select frame with overflow and run script

var doc = app.activeDocument; var sel = doc.selection[0]; var gm = sel.geometricBounds; var os = sel.appliedObjectStyle; var curtf = sel; var curpage = sel.parent; var curStory = sel.parentStory; while(curStory.overflows){      if(curpage.name ==doc.pages.lastItem().name)           curpage=doc.pages.add(LocationOptions.AT_END);      else curpage = doc.pages.item(curpage.documentOffset+1);      var temp = curpage.textFrames.add();      curtf.nextTextFrame=temp;      curtf = temp;      curtf.geometricBounds = gm;      curtf.appliedObjectStyle=os; }

Use at your own risk, I don't think it works with facing pages.

It will add frames to the following pages or add pages, the same size and position as the original, giving it the same object style.

good luck

Known Participant
August 13, 2009

Steven,

Thank you for the script. I appreciate your willingness to help me.

Unfortunately, our catalog layouts are facing pages with offset left and right margins for odd/even pages (to allow additional room for the binding). I may be able to calculate the margin offset for each page and adjust accordingly. It appears a script needs to go through a lot of gyrations to simply autoflow a text block. This is in stark contrast to how easily it is done via the shift mouse click.

Considering I am still a noob at OOP, adjusting your code to fit my needs is easier said than done. But it is always a good idea to learn something new, so I will persevere.

Thank you again,

Ike

ps: Adobe forum guidelines suggest users should let Adobe know if their products could be improved. In case anyone at Adobe reads this forum (I am beginning to wonder), I have this suggestion:

While there are many things that InDesign does far better than PageMaker, in this one instance PageMaker is far superior. In PageMaker scripting you can open the Story Editor and build a chapter within the editor. My application does this via a DDE channel. The entire story is formatted within the editor via this channel. It's awesome. When complete, the script closes the editor and the cursor loads with autoflowable text. All I have to do is place the text at a single X,Y position. It autoflows and fills all pages until the story is done. Dead simple. It is very gratifying to watch dozens of pages being created this way. Sometimes it is close to 100 pages. What used to take us months to manually create, is now done in a few minutes.

My company has been doing database publishing and creating catalogs with PageMaker since Adobe started working on InDesign version 1. Since PageMaker is a dead product, I decided it was time to replace my DDE commands with OLE equivalents. Some of the InDesign replacements are better than what I had to work with in PageMaker. Some are much better and have allowed me to skip some the gyrations PageMaker requires. But the lack of a similar method in InDesign for placing a completed story is disappointing.

Jongware
Community Expert
Community Expert
August 13, 2009

You are right: scanning through the JS Help shows both file.place and file.xmlplace have an option 'autogrow'. One would expect the same somewhere for a Story object, as it has the same function in the user interface.

Oh, and there are a few Adobe employees that read (and answer!) these forums, but I think if you put in a formal Feature Request (https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform) it ends up in some sort of database. I imagine they browse through that when looking for fresh ideas