6 Replies Latest reply on Jan 18, 2017 11:25 AM by Julia.McG

    Updating Individual InDesign File TOCs from Book

    Julia.McG

      Two related questions:

       

      1. Currently we do not have the need to utilize the Book level TOC. We have TOCs at the beginning of each chapter/file associated to the book. Is there a way/script available that when you are updating the numbering of your files from the Book level, you can also update the TOCs in each of the individual chapters/files (without manually doing it at the chapter level)?

      2. Also, can someone help me understand what synchronizing the TOC Style from the book level is supposed to accomplish. My assumption was that if I had multiple styles in my TOC styles...that I could set one style in a file and then synchronize the rest of the files using the book to "turn on/switch to" that style for the rest of the files.

       

      For example in my TOC Style dropdown (in TOC window) has listed:

        • Default
        • IG TOC
        • PG TOC

      My thought was if my IG TOC was marked as the master doc in the book and say other files currently had PG Style selected...that the synchronize feature would synchronize and change all of my other files setting from PG to IG. This does not seem to be the case.

       

      Thanks for any assistance!

      Julia

        • 1. Re: Updating Individual InDesign File TOCs from Book
          Michael Witherell Adobe Community Professional

          1. That probably could be scripted; but I don't know of an existing one.

          2. Synchronizing styles will force an over-writing of document styles, as long as they have the same name. A master style of a different name does not have the human intelligence to over-write a style with a different name.

          • 2. Re: Updating Individual InDesign File TOCs from Book
            Julia.McG Level 1

            Gotcha! I was hoping that like Conditional Text settings that the TOC Style synchronization would match up what TOC style the master was utilizing and "flip the style used."  Sounds like it just updates the style settings within the style to match between docs.

             

            I am really surprised that InDesign Books do not have the ability to update the TOCs within the individual files. We moved from (hesistate I mention it...smirk) FrameMaker to InDesign. This was an awesome feature in Frame...that I have not been able to find some work around for in InDesign. So it sounds like unless there is a script built...I have manually update my TOCs in 25 files each time...which is not impossible...just not super efficient. Thanks for your response!

            • 3. Re: Updating Individual InDesign File TOCs from Book
              BarbBinder Adobe Community Professional

              Hi Julia—speaking as a long-time FrameMaker and InDesign certified instructor, you are absolutely correct. It would make a good feature request: Wishform - Adobe InDesign.

              • 4. Re: Updating Individual InDesign File TOCs from Book
                Julia.McG Level 1

                Thanks Barb! I did not know this form was out there....it will get some use...I have a few requests:O)

                • 5. Re: Updating Individual InDesign File TOCs from Book
                  jane-e Adobe Community Professional

                  Yay! The more who speak up, the more our voices are heard! And the InDesign team does read every one of these.

                  • 6. Re: Updating Individual InDesign File TOCs from Book
                    Julia.McG Level 1

                    Hey Guys,

                     

                    I did some digging and I found another old post from 2014 with the same type of request and someone had responded with a script to try. I tried it...didn't work...BUT one of my co-workers who is ADOBE AWESOME....took the script and rewrote some parts and came up with one that works. There are two versions - one that updates all TOCs from the book without closing the files and book (which is what I wanted so I could then print the book pdf once the TOCs were updated)...and one that closes everything (this was part of the original script someone else created. I will submit this also to the Wishform to see if they can build it into an upcoming version update.

                     

                     

                    Script that updates while leaving book and files open:

                     

                    var myBook = app.activeBook; 

                     

                     

                    for(var n=0; n < myBook.bookContents.length; n++) 

                        app.open(File(myBook.bookContents[n].fullName.toString())); 

                        for (var i = 0; i < app.activeDocument.allPageItems.length; i++) 

                        { 

                            var myPageItem = document.allPageItems[i]; 

                            if(myPageItem.getElements()[0].constructor.name == "TextFrame") 

                            { 

                                myPageItem.select(); 

                                try{ 

                                    app.scriptMenuActions.itemByID(71442).invoke(); 

                                }catch(e){} 

                            } 

                        } 

                    }

                     

                    Script that updates closing book and files once run:

                     

                    var myBook = app.activeBook; 
                     
                     
                    for(var n=0; n < myBook.bookContents.length; n++) 

                        app.open(File(myBook.bookContents[n].fullName.toString())); 
                        for (var i = 0; i < app.activeDocument.allPageItems.length; i++) 
                        { 
                            var myPageItem = document.allPageItems[i]; 
                            if(myPageItem.getElements()[0].constructor.name == "TextFrame") 
                            { 
                                myPageItem.select(); 
                                try{ 
                                    app.scriptMenuActions.itemByID(71442).invoke(); 
                                }catch(e){} 
                            } 
                        } 
                        app.activeDocument.close(SaveOptions.YES); 

                    app.activeBook.close(SaveOptions.YES);

                     

                     

                     

                    Want to pass along credit to Update TOC from the Book Pane  for helping get to a script solution. This post was a great starting point!