🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
3 messages
3 total messages Started by Eric_Christensen Fri, 02 Jan 2009 20:07
creating TOC from a Book file
#2388
Author: Eric_Christensen
Date: Fri, 02 Jan 2009 20:07
17 lines
1263 bytes
I am new to scripting and have so far been able to muddle my way through what I want to do, but here�s one I can�t figure out or find any examples of.

I am trying to create a table of contents from a Book file in InDesign CS3 using JavaScript.

I have been able to get the script to create a TOC style named tocStyle.

Here is how I try to generate the TOC:

myBook = File.openDialog();
myBook = String (myBook);
myTOCStyle = app.activeDocument.tocStyles.itemByName("tocStyle");
app.activeDocument.createTOC(myTOCStyle, true, myBook, [42, 123], true);

This generates a TOC, but only from the active document and not from the other documents in the Book.

thanks for any help you can provide,
Eric
Re: creating TOC from a Book file
#2389
Author: Peter Kahrel
Date: Fri, 02 Jan 2009 20:16
12 lines
960 bytes
Eric,

You do this:

. . .
myBook = String (myBook);
. . .
app.activeDocument.createTOC(myTOCStyle, true, myBook, [42, 123], true);

The description in the OMV says that myBook should be of type Book, but you pass a string to createTOC(). Maybe instead of myBook = String(myBook), try something like myBook = app.books.item ("soandso").

Peter
Re: creating TOC from a Book file
#2391
Author: Eric_Christensen
Date: Fri, 02 Jan 2009 21:14
7 lines
798 bytes
Thanks for the quick response, Peter.

You gave me the answer I needed.

I'll have to come here with my questions more often.

Eric
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads