8 Replies Latest reply on Oct 17, 2011 7:14 AM by stoereee

    [CS5 Server/JSX] Generating TOC at beginning of document

    stoereee Level 1

      Hi,

       

      The following script is generating a toc:

       

       

      
        myTOCStyle = myDocument.tocStyles.itemByName("TOC");
        myMasterSpread = myDocument.masterSpreads.item("A-Master");
        myTocPage = myDocument.pages.add(LocationOptions.AT_BEGINNING, myMasterSpread);
        myIndexFrame = myDocument.textFrames.lastItem();
        myBounds = myIndexFrame.geometricBounds;
        myX1 = myBounds[1];
        myY1 = myBounds[0];
        myDocument.createTOC(myTOCStyle, true, undefined, [myX1, myY1]);
      
      

       

      When I run this Script on InDesign Server CS5, it is generating a TOC, but it is not placing it on the just added page at the beginning. It is placed at the first page containing the content where the TOC is generated from. Also the page added at beginning does not contain any master-page items, it's just a blanco page.

       

      When I run this Script on InDesign Desktop CS5, the toc is placed at the first page added with this script. This page also does not contain any master-page items!?

       

      How can I place the TOC (with text overflow) before the first page containing the content. The page containing the TOC must contain master-page items.

       

      Sjoerd