Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Double posting: https://indesignsecrets.com/topic/indesign-to-excel#post-92213
Copy link to clipboard
Copied
Mr. Kai,
As you know I didn't find my answers on InDesign Secrets, that's why I asked it again here.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
can u provide me link of your website ?
do u have script for indesign to excel ?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
late but still 🙂 look for —- in your text.
you can achieve this by 2 scripting languages. Javascript and Autohotkey. (im not a programator – it is my hobby) but my idea is:
JS can select all text on the page and copy to clipboard. Then use AHK to split text based on paragraphs characters (all indd file have to same layout – same numbers of paragraphs) here:
Inspired by our popular Rapid Assault Combat Shirt, the Rapid Response Half-zip is built from a high performance, quick-dry, two-way stretch polyester/spandex fabric that provides a snug and secure fit without bunching or rolling. An ideal bottom or mid layer, the Rapid Response features a moisture wicking finish that keeps you warm and dry, a secure zip pocket on the left arm, an embossed loop platform on the left arm, and stylish embroidered 5.11 branding.
—– HERE are first 2 paragraphs in a row = desctriptions
Overview:
+ High performance two-way stretch fabric
+ Moisture wicking, quick drying
+ Zippered sleeve pocket at left bicep
+ Scope embossed loop platform on right bicep
—– HERE are 2 paragraphs in a row = find word “Overview” and all text until 2 paragraphs appear (AHK will put this text to excel – specific cell)
Specifications:
+ 92% polyester / 8% spandex torso
+ 91% polyester / 9% spandex sleeves, shoulders, and collar
+ Embroidered 5.11 branding
+ Also available in RealTree XTRA
—– HERE are 2 paragraphs in a row = find word “Specifications” and all text until 2 paragraphs appear
(All will be a buletts part – (AHK will put this text to excel – specific cell)
72415 Rapid Half Zip | 092 Storm, 190 TDU Green, 709 Regatta | S-2XL
62381 Women’s Rapid Half Zip | 018 Charcoal, 498 Blush, 831 Sage Green | XS-XL
72424 Realtree Rapid Half Zip | 302 RealTree XTRA | S-2XL
72444 Rapid Half Zip | 018 Charcoal, 120 Coyote, 831 Sage Green | XS-XL, XXL
…and so on all via GREP.
then AHK jump to another page and repeat the process.
I belive this can be done just with Javascript, but i cant do this. But with combination with these two languages i am able to do this.
so maybe in future projects 😉
Copy link to clipboard
Copied
Have u got solution of your issue ?