2 Replies Latest reply on Mar 11, 2014 2:48 AM by vereeckG

    Conditional Text Synchronize

    vereeckG

      Hi,

       

      We're a translation company that are translating huge Indesign books with lots of tables (and numbers). To make sure no errors are made in the numbers, I've set up a process where we create a new condition for all the numbers in the document and then hide the condition.

       

      It is possible to open all the files in a book using a script. I then create the condition in a single file in the book, and using Find&Replace in all Documents I'm able to apply the condition to all documents in the book. I can also use the 'Synchronize book' options to set the condition to invisible on all documents in the book.

      So this all works wonderfully.

       

      However, when we need to finish the files, I need to remove the condition in all the documents in the book. If I delete the condition in the style source document and then synchronize, the condition is not removed in the other documents in the book? I can use find&replace to replace our condition back to 'unconditional', but the condition remains in the list for conditional text, and we'd like it gone.

       

      Is there any way to delete a condition for all open documents, or all documents in a book? At the moment, we need to go through all documents and delete the condition in each one.

      (as we translate books with 20+ documents to 25 languages, that is 20+ times 25 of clicking, which is somewhat tedious )

       

      Kind regards,

      Geert

        • 1. Re: Conditional Text Synchronize
          Peter Spier Most Valuable Participant (Moderator)

          I think you need to script that, too.

           

          It doesn't disappear when you synch because that's the way it's supposed to work. You add missing componenets, redfine same named ones, and leave alone anything not defined in the source.

          • 2. Re: Conditional Text Synchronize
            vereeckG Level 1

            Hi Peter,

             

            thnx for the feedback..I've made a script to remove the condition in all documents in a book. If anyone is interested, here is the code:

            //Removes conditional text - name can be chosen at prompt
            
            var myBook;
            if( app.books.length > 0 ){
                                //Select the currently active book.
                                myBook = app.books.firstItem();
              
                                //Check if the book contain any pages.
                                if( myBook.bookContents.length > 0 )
                                {
                                          var myDocuments = myBook.bookContents;
                                          var nrOfDocuments = myBook.bookContents.length;
                                //Specify condition name to be removed 
                                var name_cond = prompt ('Condition to remove', 'Please enter condition name');
              
                                          for( i=0; i < nrOfDocuments; i++ )
                                                    {
                                                              var myDocument = myDocuments.item(i);
                                                              var path = myDocument.fullName;
                                                              var doc = app.open( path, false );
                                                              if (doc.conditions.itemByName(name_cond).isValid)
                                                    try
                                {
                                                    doc.conditions.itemByName(name_cond).remove ();
                                                    doc.save();
                                }
                                catch(e){
                                                    alert('Do nothing, moving along');
                                }
                                                    }
                                }
            }
            

             

            Thnx for the quick reply,

            Geert