-
1. Re: Generate TOC with JavaScript
Jump_Over Oct 11, 2013 12:41 AM (in response to Dan-BTP)Hi,
Move its text container (this is array of stories):
//... var doc = app.activeDocument, mTOC = doc.createTOC(doc.tocStyles.item("TOC"), true, null, ["1.0i", "1.0i"])[0].textContainers[0]; mTOC.move(doc.pages[1]); mTOC.move(["1.0i", "1.0i"]); //...Jarek
-
2. Re: Generate TOC with JavaScript
Dan-BTP Oct 11, 2013 12:00 PM (in response to Jump_Over)Jarek,
Thank you for the helpful suggestion, which I tried. It works, but I have two questions:
1. I already have a text frame on page 2 that is set up for automatic reflow. If my TOC takes more than one page, how do I deal with that with the move technique? I would prefer to grab the story contents from the TOC and put them in the text frame on page 2. Is this possible?
2. The main body of the document ends up with 28 pages of connected text. When I omit the createTOC step, the document flows properly and I have no overset text. When I include the createTOC (whether I leave it on page 1 or move it to page 2), the automatic reflow stops about three pages before the end of the document and gives me an overset text error. The only code difference in these two scenarios is whether or not I comment out the createTOC statement. Any idea why it messes with the automatic reflow of the body text?
Dan
-
3. Re: Generate TOC with JavaScript
Jump_Over Oct 11, 2013 2:44 PM (in response to Dan-BTP)Hi,
1. I already have a text frame on page 2...
While creating TOC its textFrame is marked so TOC story could be updated easy. If you move a story - not a text Frame - this connection is broken.
None the less you can use a move method to a story as well. (see http://jongware.mit.edu/idcs5js/pc_Story.html#move)
2 ... the automatic reflow stops about three pages before the end of the document and gives me an overset text error....
Hard to say anything with no look at the code...
Jarek

