2 Replies Latest reply on Nov 7, 2012 7:43 AM by Grant H

    Exporting text.doc from an InDesign file




      I have about 400 pages, each with one textframe that is linked throughout all 400 pages. Each page also has a separate 'header' textframe that isn't linked. I need to export just the text from both of these textframes, but the headers need to somehow be "inserted" between each linked textframe on each page.


      I can easily copy/paste the entire linked textframe, it's getting the headers in there too that is the issue. Make sense?

        • 1. Re: Exporting text.doc from an InDesign file
          Jump_Over Level 5


          I think this is a good job for a script.

          I.e. like this:


          myDoc = app.activeDocument;

          myTextArr = new Array();

          var myTextStory = currHead = currText = "";

          for (k=0; k<myDoc.pages.length;k++) {

              currHead = currText = "";

              for (f = 0; f<myDoc.pages[k].textFrames.length; f++)

                  switch (isLinked( myDoc.pages[k].textFrames[f] ) ) {

                      case true: {currText = myDoc.pages[k].textFrames[f].contents; break;}

                      case false: {currHead = myDoc.pages[k].textFrames[f].contents; break;}

                      default: {currHead = currText = ""; break;}


              if(currHead!=="") myTextArr.push(currHead);

              if(currText!=="") myTextArr.push(currText);



          myTextStory = myTextArr.join("\r");

          myFolder = "~/Desktop"               // You can edit this

          ExportFile = new File(myFolder + "/" + "InDesign_Export.txt");          // You can edit this

          ExportFile.open("w",undefined, undefined);




          function isLinked(myTF){

              if(!myTF.isValid) return -1;

              if(myTF.startTextFrame == myTF.endTextFrame) return false;

              else return true;



          It should be saved as .jsx file and placed in your Script Panel folder.

          To run - double click in InDesign script panel.


          • 2. Re: Exporting text.doc from an InDesign file
            Grant H Level 4

            Why dont you export the document to PDF, then open the PDF,


            file>save as>microsoft word>word document.


            click settings in the Save As, dialogue box, and select retain flowing text, uncheck comments, uncheck Include Images, uncheck Run OCR. Click Ok