6 Replies Latest reply on Oct 20, 2015 12:44 PM by Ronald63

    Need to import a text layer into a InDesing file from another one.

    Sriracha

      I have different translations in different InDesing files.
      Now I need to import/merge the files as new layers in one single InDesign file. Is there a way to do this?

       

      My InDesign file has pictures/graphics in the first layer and above I have different languages.

      It's about 100 pages - I don't want to copy paste, page -by-page.

      Somebody - Ay idea?

      Thanks,

        • 1. Re: Need to import a text layer into a InDesing file from another one.
          przemek_macko Level 1

          are those text Frames in the same position on pages, through all documents?

          • 2. Re: Need to import a text layer into a InDesing file from another one.
            S Hopkins Adobe Community Professional

            Depends on how your documents are created. If your documents are set up page by page (both documents have same number of pages and all pages have same contents, just different translations) then a script such as the following may work for you. (Written in AppleScript).

            To use, make sure both documents are open. Receiving document needs to have a layer named the same as the source layer from the target document. In this example, the receiving document is the English document ("Test_English.indd") and the source document is "Test_Spanish.indd". The English document has its text on layer 1 but also has a layer named "Spanish" which corresponds to the layer named "Spanish" in the source document. The "Spanish" layer must be visible and not locked in both documents. Make a duplicate of both documents and save in protected location just in case.

            With that, you can copy the following script into AppleScript editor and run (command+R) or save as a Script format from AppleScript editor and run from the script menu in InDesign.

            //Script copies all pages from source document to receiving document.

            tell application "Adobe InDesign CC 2015"

              tell clipboard preferences

              set paste remembers layers to true

              end tell

            --receiving document

              set docRef to document "Test_English.indd"

            --gets count of spreads in receiving document

            set numSpreads to count of spreads of docRef

            --repeats through each page to copy from source document to receiving document

              repeat with i from 1 to numSpreads

              set active document to document "Test_Spanish.indd"

              tell spread i of document 1 to select all

              activate

              copy

              set active document to document "Test_English.indd"

              set active spread of active window to spread i of document 1

              paste

              end repeat

            end tell



            • 3. Re: Need to import a text layer into a InDesing file from another one.
              Sriracha Level 1

              Yes, all the same through the document.

              The idea is to keep all "colour" in background and just change the "black" (inkluding language) on top = only change the "balck plate". I got 6-8 differnet languages. The translators working on this project on the same time and I like to have it all put together in the end. It's time consuming to "drag" it all together.

              Thanks,

              • 4. Re: Need to import a text layer into a InDesing file from another one.
                Sriracha Level 1

                Thanks, Yes the documents are just as you describes. Wow, sounds lika a beautiful script you got . But i don't think the Apple script would work I'm runnning ID on PC

                • 5. Re: Need to import a text layer into a InDesing file from another one.
                  przemek_macko Level 1

                  do you know how translate this to js code?

                  • 6. Re: Need to import a text layer into a InDesing file from another one.
                    Ronald63 Level 4

                    Hi,

                     

                    A quick translation in JS...

                     

                    with (app.clipboardPreferences){
                        pasteRemembersLayers =true;
                    }
                    
                    var docTarget  = app.documents.itemByName('Test_English.indd');
                    var docSource = app.documents.itemByName('Test_Spanish.indd');
                    
                    if (docSource.isValid  && docTarget.isValid){
                        var numSpreads = docSource.spreads.length;
                        for ( var i = 0; i < numSpreads; i++ ) {
                               app.activeDocument=docSource;
                               app.activeWindow.activeSpread = app.activeDocument.spreads[i];
                               app.select(app.activeDocument.spreads[i].allPageItems);
                               if (app.selection.length >0){
                                    app.copy();
                                    app.activeDocument=docTarget;
                                    if (app.activeDocument.spreads[i].isValid){
                                        app.activeWindow.activeSpread = app.activeDocument.spreads[i];
                                        app.pasteInPlace();
                                    }
                               }
                        }
                    }
                    

                     

                    Hope this helps

                    Regards