6 Replies Latest reply on Feb 15, 2017 7:20 AM by Masood.Ahmad

    InDesign to Excel

    Masood.Ahmad Level 1

      Hi,

      Is it possible to automate the extraction of text from InDesign to Excel in a given order:

       

      I have uploaded a source InDesign file with markups, see “InDesign2Excel_Input.indd”. The text is in one single text-frame and in cells as well.

       

      I have manually copied and pasted the text from InDesign to Excel for this one, see “InDesign2Excel_Output.xlsx”

       

      Files can be downloaded from here:
      https://www.dropbox.com/s/26ykzxb7ijzq7z5/InDesign2Excel.zip?dl=0

       

      Can someone suggest a workflow to automate the process for 500+ pages. A script would be more helpful.

      Thanks in advance.

        • 2. Re: InDesign to Excel
          Masood.Ahmad Level 1

          Mr. Kai,

          As you know I didn't find my answers on InDesign Secrets, that's why I asked it again here.

          • 3. Re: InDesign to Excel
            Kasyan Servetsky Level 5

            Sure, it can be scripted. A couple of days ago -- being on vacation and having nothing to to -- I wrote a function that does the opposite: reads the data from Excel (everything from the first spreadsheet) and sends it to InDesign as array. Also, I made a new version of my Change fonts script which uses this function (so to say a practical example) which now reads data directly from Excel instead of CSV-file.

            Soon I'm going to post them on my site.

             

            In your sample, I see a big problem: all text is in the same text frame and both a paragraph and a character style is applied to it (the same styles to all text!). How can the script detect, in this case, which part of text should go to which column in the spread?

            Ideally, you have to split the text into five separate frames and set labels to them (in the Script Label panel).

             

            — Kas

            • 4. Re: InDesign to Excel
              Masood.Ahmad Level 1

              Kas, creating five separate frames and setting labels would be equal to copying and pasting the text from InDesign to Excel. I did a test run on the file by couple of team members and got an average of two minutes per page time. Making a total of 17 hours job. The only problem I see is, how I'll make sure that the copy and pasting has been done correctly. This doubt will force me to double check the data. Whereas a script will eliminate this process and I don't have to worry about anything, just a random check would be fine.

               

              In total, I'm looking for a one click solution.

              • 5. Re: InDesign to Excel
                Kasyan Servetsky Level 5

                I don't think it's possible to do with a script in a file like you provided. It would be possible if you had applied different par/char styles to each section so the script could differentiate them.

                — Kas

                • 6. Re: InDesign to Excel
                  Masood.Ahmad Level 1

                  I totally understand the complexity of the job that's why I posted it here, just to try my luck.

                   

                  If the file had been styled properly, then I might have Map the Styles to Tag and exported it to XML and finally converted to Excel.