Skip to main content
john_problem
Known Participant
June 1, 2018
Question

Importing XLS contents into gazillion text frames

  • June 1, 2018
  • 1 reply
  • 643 views

Hi!

I have a huge leaflet with around 4000 different text frames (names, descriptions, prices of different products), and I need to translate it into couple different languages. I have translations in the XLS file, so I figured out I can import it and mass replace the content of the text frames. I did sth similar in Photoshop once, but it seems much more complicated in Indesign. So I need help:

  1. In Photoshop, from what I remember, you just define that that particular text field is 'named' for example 'TXT_VAR_1', and the other one is 'TXT_VAR_2', and than you can replace the content with data sets. But in Indesign there doesn't seem to be a way to 'name' a text field, am I right? So how do you define it?
  2. Also, I've read that data sets are replaced with data merge, but it works in a different way. For example in Photoshop my file that I imported look like that:
       TXT_VAR_1, TXT_VAR_2, TXT_VAR_3...
       sth1_in_en, sth2_in_en, sth3_in_en...
       sth1_in_pl, sth2_in_pl, sth3_in_pl...
    The first row are the names of the variables, the second are the contents in English, the third one in Polish, and so on. And those rows turn into data sets, which I can easily change. Is it possible to do it the same in Indesign?
  3. What about the pages/spreads. Do they limit the data merge? What I mean - can I mass replace the contents in the entire document, or just on one spread?

Thanks!

This topic has been closed for replies.

1 reply

Kasyan Servetsky
Legend
June 2, 2018

Hi there,

This can be done by script. Here I posted a function which gets data from Excel: only plain text without formatting.

I would create an InDesign template (indt-file) with labeled text frames (using the script label panel) so the script would know which data where to place.

— Kas

john_problem
Known Participant
June 2, 2018

This sounds awesome! I'm installing the script now, but just to make - from what I understood from the example described on the script page - the number in my case would be the language, and A, B, C... are the different data fields. So A1 is for example the name of the product in Polish, B1 is description in Polish, A2 is name in German, B2 is the description in German, and so on. So is it possible to mass switch between these languages?

john_problem
Known Participant
June 2, 2018

Another question - I've tried to use your script, but it stops at: http://prntscr.com/jpvt9f . The bottom error says sth like "inconsistency of types: 'matrix(...)'. I'm using Indesign CS6.


And if I use the 2.0 version of the script - it does something, even excel opens for a second (and closes immediately) when I run the script, but I don't see any results and in JS console it says "Result: undefined"

PS. Sorry for third post in a row!