Creating a TOC

Hi,
I searching for a solution to create a toc programatically.
I have found the description in createtocsnippet.cpp but still I can't put the TOC to a frame automatically.
It still ends up in displaying the mouse cursor to place the toc.
The command kCreateTOCCmdBoss seems to create the toc and it looks like it places the toc, but Indesign it self says no toc created.
If I use additional kFormatTOCCmdBoss to get the formating of the toc, I can't place it in a frame automatically.
Any help would be much appreciated.
Torsten

Hi,
It looks like you have inserted the script in the "XML Source" tab. Would not advise that! The XML Source tab is fine for minor amendments / tinkering, but is not the best place to insert script.
When you have LC open in Design view, there is a window at the top called "Script Editor" (available under the Windows menu).
If this is a single line, it is worth dragging the bottom bar down so that you see a few lines of script at a time.
Create a button on the page and then in Script Editor select the click event. You can then insert your text, as below:
The script would be as before, but without the tags (LC inserts these automatically).
var choice = app.popUpMenu("Page 1", "Topic 1", "Topic 2", "Topic 3");
     if (choice == "Page 1")
          xfa.host.currentPage = 0;
     if (choice == "Topic 1")
          xfa.host.currentPage = xfa.host.numPages -7;
     if (choice == "Topic 2")
          xfa.host.currentPage = xfa.host.numPages -6;
     if (choice == "Topic 3")
          xfa.host.currentPage = xfa.host.numPages -5;
In the example above I am counting backwards from the total number of pages. If you document is static (number of pages does not increase) you can just script using "xfa.host.currentPage". Just remember that the page numbers are based on a zero numbering system.
Hopefully you should end up with somethin like this:
Good luck,
Niall

Similar Messages

  • How do I create multiple TOC's (Tables of Contents) in one Pages document?

    I'd like to have multiple TOC's (Tables of Contents) in one document. This is useful for me because I'd like to have a TOC for the regular chapters, then a TOC for the procedures, then a TOC for the tables in the document (it's a tech manual that I am writing). How can I do this? Thanks for any help you can render, and have a nice day!

    fruhulda wrote:
    If you haven't used a paragraph style it can't create a TOC but you get the blue box with the message.
    Paragraph used.
    It has nothing to do if there is one main TOC or several smaller TOC to do.
    It isn't true that you can only have one TOC in a document. Use styles for your titles and headings. I do and it works fine without section breaks.
    You also need to tick which tile and heading you want in the TOCs in the Document Inspector > TOC
    Did that.
    Thanks to Yvan's quoting from the User Guide, I see where it says each TOC only indexes the material up until the next TOC. Since I had them follow each other, that is why they had no content.
    Still it defeats the objective of indexing different material throughout the document if all you get is what is between the TOCs.
    Peter

  • Creating a TOC in Pages 09

    Created a document using a BLANK word processing format in Pages 09, not a template. I want to create a Table of Contents. When I review the users guide, it states that I need to use a template in order to create a TOC. What do you think

    What on page 62 does not apply to a Blank Template? I understand that you are using the Blank, but what I don't think that you understand is that Blank is a Template.
    Is this what you are choosing?

  • Creating a TOC via script on InDesign Server [CS5.5]

    I have been struggling for about two weeks with trying to figure out how to script the creation of a TOC and an index for a book.  I've successfully created the book, and have also been able to create the table of contents, however I cannot place the contents in the book.  From the UI it's simple because it loads up the cursor with the TOC contents.  But in script, it simply provides an array with a single Story object.
    I have no idea how to make the story appear in my document.  Here's my current code:
    var book = app.open("book.indb");
    var doc = app.open("table_of_contents.indd");
    var tocStyle = doc.tocStyles.firstItem();
    var stories = doc.createTOC(tocStyle, true, book, ["1in", "1in"], false, doc.layers.firstItem());
    When I hit that final line, I get the following error:
    Invalid value for parameter 'destinationLayer' of method 'createTOC'. Expected Layer, but received Layer.
    Okay... so, if it's expecting a Layer and I'm providing a Layer - what gives?
    Originally I had figured that I:
    Had to create a TOC document from a template which contains a single text frame that automatically flows from page-to-page (using a master)
    Add the document to the book at the beginning
    Copy the contents of the Story into the TextFrame
    Iterate the Lines collection of the Story, copying the paragraph and character styles for each line
    This works, but it's no longer a TOCStory type.  I would like to maintain the TOCStory type and just have the content flowed into the new document which I add.  This makes sense, logically, but I know that nothing in InDesign is really that logical.  It seems to be a lot of collection manipulations, but I cannot figure out which collections to manipulate.
    The Index.generate() method seems so much more logical because the first argument is where to place the content.  If it were only that simple for the TOC!  If you've had experience doing this, please let me in on the secret...  I don't have access to the menu items so I cannot invoke actions.  Those threads don't seem to apply for InDesign Server (and that makes sense, since it's headless)
    Thanks,
    - Brett

    Hi Brett,
    here is the code that worked for me.
    Michael
    var bk=app.books.add(File("C:/Users/wwadmin/Desktop/testbook.indb"));
    for(i=0; i<5; i++){
    var doc=app.documents.add()
    var page=doc.pages.firstItem()
    var frame=page.textFrames.add({geometricBounds:[0,0,'10in','10in']})
    frame.contents="Hello World!!!!!";
    var style=doc.paragraphStyles.add({name:"Body"});
    frame.paragraphs.firstItem().appliedParagraphStyle=style;
    doc.save(new File("C:/Users/wwadmin/Desktop/doc"+i+".indd"))
    bk.bookContents.add(File("C:/Users/wwadmin/Desktop/doc"+i+".indd"));
    var doc=app.documents.add();
    var page=doc.pages.firstItem();
    style=doc.paragraphStyles.add({name:"Body"})
    tocstyle=doc.tocStyles.add({name:"myStyle"});
    tocstyle.tocStyleEntries.add({formatStyle:style, name:style.name});
    doc.save(new File("C:/Users/wwadmin/Desktop/test.indd"))
    bk.bookContents.add(File("C:/Users/wwadmin/Desktop/test.indd"));
    doc.createTOC(tocstyle, true, bk, undefined, true, doc.layers.firstItem())
    bk.save()
    for(a=app.documents.length-1; a>(-1); a--){
    app.documents[a].save(File(app.documents[a].fullName));
    app.documents[a].close();
    bk.close()

  • Creating a TOC in pages

    Can someone help in creating a Table of Contents (TOC) in Pages? I'm new to the Pages world, and am currently creating a document on the iCloud site with Pages. I can't seem to find a link, button, etc for creating a TOC.

    What on page 62 does not apply to a Blank Template? I understand that you are using the Blank, but what I don't think that you understand is that Blank is a Template.
    Is this what you are choosing?

  • Best approach to creating a TOC for product catalog using data merge

    What is the best approach for creating a TOC for a product catalog (over 1,000 items) using Data Merge?
    The TOC would contain the product Categories. 
    So for example, Category A items could go from pages 1 - 3, and Category B items would start at pg 4, but if new items were added to Category A, then Category B may start from pg 6. 
    From the Data Source, there are 5 Data Fields I've chosen to be displayed.  If this were a regular digital print document, I could use the Paragraph Style method for creating a TOC, but if I make any one of the Data Fields a certain Paragraph Style and use that for the TOC, it'll populate the TOC with that Data Field for all the items. 
    Any suggestions?

    Peter Spier wrote:
    TOC is not interactive in the ID file, though it can be in a PDF that you export (there's a checkbox to create PDF bookmarks). You might want to think about using Cross-references (rather than hyperlinks, I think) to build the TOC. You have to do it manually, but once done it should maintain itself, whereas a TOC is built automatically, but must be regenerated after you edit the doc.
    One caveat witih TOCs created from cross-references: Although changing the text of an x-ref source paragraph (for example from "Patatas and tamatas" to "Tomatoes and Potatoes,"and/or when the source paragraph flows to the next or previous page) update automatically or when invoking "Update cross-references," MOVING a cross-reference source paragraph to a location before or after another source paragraph, does not change their sequence in the pseudo-TOC. You'll need to manually move the reference in the pseudo-TOC to the correct position in the sequence of cross-refs. So, put the task of checking the order of x-refs in the pseudo-TOC on your before hand-off check list.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Is it possible to create a ToC on Pages for IOS ?

    Hello
    Is it possible to create a ToC on Pages for IOS ?
    If its not possible its really a must have feature !
    Regards

    Creating a ToC with Pages for iOS doesn't seem possible. To let the good folks at Apple know how you feel, send your feedback to them:
    http://www.apple.com/feedback/

  • Create a toc from adobe flash as3?

    hi guys
    i wante to create a completely toc in adobe flash as3? is there any way to do this?
    for example i want to create a toc file with full size logo (photo form toc information)
    or change duration location with slide title
    i want also another questiion about sdk folder in adobe captivate, i found some swc file in this folder, but i want documetion to use this swf file in custome development,
    thank

    Hi
    Please elaborate a bit more as you want users to download pdf from your site or print site page as pdf etc
    If its regarding documents then you can add add df documents in your site and then link them to pages where users can download the pdf, if you are referring to print page then you can provide information for ctrl+p/cmd+p , or add html code for print shortcut.
    https://forums.adobe.com/message/6319543
    Thanks,
    Sanjit

  • It sounds stupid but I cannot figure out how to create a TOC

    It sounds stupid but I cannot figure out how to create a TOC

    You'll find some good video tutorials with these Google searches:
    (search Google for these terms without quotes)
    * indesign paragraph styles tutorial
    * indesign table of contents tutorial
    * InDesign paragraph styles in table of contents tutorial
    The simple principle is: InDesign creates a TOC by "pulling out" heading paragraphs from your document. To help it know which paragraphs are the headings you want in the TOC, you need to create paragraph styles, and apply them to the heading paragraphs. Then, when you perform Layout > Table of Contents, you choose the heading paragraph styles, and run the process.
    It may be daunting if you've never done anything like this. But, if you've done it in MS Word or other word processor, the principle is the same - make the headings identifiable in some way, so the software can extract them.
    Look at the video tutorials, create a heading paragraph style, create a TOC, and let us know the result.
    If your document is one of several that are gathered into an InDesign book, search Google for terms like "working with InDesign books tutorial," and "InDesign book table of  contents tutorial," without quotes.
    It would help if you can provide screen shots of your result. Search Google for terms like "how to create a screen shot on mac," or "how to create a screen sot on windows," without quotes. It also helps to display hidden characters when you make the screen shots. Search Google for terms like "how to display InDesign hidden characters," without quotes. Search Google for terms like "how to post a screen shot on an adobe user forum," without quotes.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • How to create multiple TOCs

    Is there a way to create a TOC, Table of Figures, and Table of Tables one after the other up front in a document? We used to do this all the time when we wrote technical manuals. Is there a workaround of any kind?
    Thanks,
    Keith Rowell

    On that note: is there a way to auto add table and figure numbers, so it would read Figure 1-1 Flow Diagram?
    I know Nisus does this using list styles, but it looks like Pages is different.

  • How to create a TOC without adding a page to project?

    Hello,
    Am trying to add a table of contents to my brochure in indesign CS6  but I don't want to include it in my print job or to add  additional page to my brochure? I really just want so that when I export it to a PDF it will give me the option to just click on the TOC and it will take me to that page instead of just scrolling down and searching for what they are looking for?? Thank you in advance for all the help am new a this.

    Select the object or text frame that you don’t want to be printed.
    Open the Attributes panel (Window > Output > Attributes).
    In the Attributes panel, select Nonprinting.
    OR
    Choose Window > Layers.
    To create a new layer above the selected layer, click the New Layer button
    Specify layer options -Print Layer- Uncheck this option to make non-printing layer

  • Auto Creating a TOC in RH8 (for FlashHelp) problem

    When I opened my RH8 project today and autocreated the TOC, all books disappeared except for the new one I created today. I painstakingly recreated the TOC with 10-12 books and contents, saved frequently, and regenerated the project, displayed it in Flash -- TOC displays OK.  However, when I use the Auto Create TOC option (deselecting the Delete Previous TOC checkbox), it creates a one-book TOC (the one book I added today).  Something seems to be broken with the auto-create TOC function.  Any clues?
    Thanks.

    Hi there
    Awfully hard to say what has happened here without seeing your project first hand. Are you using Folders to organize topics? Is the content purely HTML files or is it content that is linked to a Word document?
    Cheers... Rick
    Begin learning RoboHelp HTML 7 within the day - $24.95!
    Click here for Adobe Certified   Captivate and RoboHelp HTML Training
    Click here for the   SorcerStone Blog
    Click here for RoboHelp and Captivate eBooks

  • Can you create a ToC with nested character styles?

    I'm creating a technical guide document, and for ease of formatting within document creation I've used nesting character styles within the 'Body' paragraph style. I need to reference the second level headings within the ToC, but I since I can only use the 'Paragraph' styles in ToC creation - can I do this? (I'm using InDesign CC)
    The document looks something like this, with the italics indicating the nesting structure and the ** indicating what needs to go in ToC.
    1. Our Story (separate paragraph style, not an issue)
    1.1 Random Title Goes Here ("Body" paragraph style, nested "Heading 2")**
    Body text now, all over here, several paragraphs, etc. ("Body" paragraph style, nested "Body")
    Subheadings - not required in ToC ("Body paragraph style," nested "Subheading")
    1.2 Random Section Title goes here ("Body" paragraph style, nested "Heading 2")**
    More body text, you get the gist. ("Body paragraph style, nested "Body")
    Basically, I need to build my ToC with the Heading 1 and the Heading 2, but Heading 2 is nested in "Body" paragraph style.

    Nested styles are NOT a TOC style function, it is only available in a paragraph style. But when you choose a paragraph style to be written into your TOC based on another Para Style, most likely a headline, you can define such nested styles in this para style.
    But a TOC entry can only include a complete paragraph, a single one. You can make a Para Style, let's name it TOC1 which draws the information from Headline 1, but not for headline 2.
    This TOC1 can include nested styles (or GREP styles).
    Another way to define chara styles automatically is via the TOC style definition. Styles there will override any styles which come from nested and GREP styles. (But this does not necessary mean, that they have no functionality any more, because ID's styles are only partially defined and leave room for other elements of a style to be used together.)

  • Creating a TOC or Index for a pdf?

    Is it possible to create a word index or table of contens for a pdf that doesn't have one from Acrobat Pro?

    Indices or TOC should be created in/from your original document. You can use the bookmarking feature in Acrobat to simulate the function of a TOC.

  • Create a TOC for a course that has multiple projects

    I have Captivate 4. Previously I could create a menu for a project that would link to other  project files in the course using the Skin Editor. When I clicked the TOC tab in the skin it listed slides for the one project I was in. How do I add links to the other modules (project files) in the course? Thank you.

    Hi there
    One way to accomplish this is by using the Aggregator to link projects together using a unified TOC.
    Another way to accomplish it is to configure a slide with an On Enter action of opening the desired project. Then point the TOC entry to that specific slide.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

Maybe you are looking for

  • How to add a second row in an IRR report header

    I have a report with 19 columns. Right now I have a bunch of columns that look like: 0-19 Males   | 0-19 Females  |   20-30 Males   |  20-30 Females 24                  22                      16                     17 I need it to look like: 0- 19  

  • Crm_order_maintain for opportunity

    Hi Using fm crm_order_maintain in badi order_save to populate organisational data. I am using bapi_transaction_commit and crm_order_save after crm_order_maintain but it is called recursively resulting in short dump. Can somebody share code for a simi

  • Compsite Primary Key question

    Hi guys, First of all, I am really newbie in DB deals. There are "best practices" about the order/position of the columns of a composite primary key?... By instance, I have a table named STOCK: CODE ISSUE STATUS etc... 1020 2007 OK 1030 2007 OK 1040

  • HT4528 Is there a way to interface a Iphone 5 with a non wireless network via a RJ45 connector?

    I am trying to find a way to connect my Iphone to a non wireless network to assist in network diagnosis. I don't know if the Iphone is even capable of this, but if it is, this will be an extra way to get more out of it. I am needing to connect it to

  • Stuck uploading and can't tap on document

    I have a lot of documents being stored on iCloud and went to open. The document looks transparent with up arrow icon in top right. Help me