Copy link to clipboard
Copied
Hi, I have an excel spreadsheet with a column of dimensions, height and width. What I would like to do is import this list into Indesign and run a script creating frames/ boxes. In addition to merging this list and creating boxes, I would hope to have these boxes align in a linear pattern each meeting up with the other flush.
Thanks in advance,
Your request implies a few fundamental bricks such as :
- loading CSV data (given you can't load EXCEL by default)
- Adding frames to a page (the scripting guide is full of samples)
So start exporting EXCEL to CSV, then look around for loading CSV. Come back then with a snippet of yours we can comment.
Copy link to clipboard
Copied
[moved from Adobe Creative Cloud to InDesign]
Copy link to clipboard
Copied
Moved to scripting...
Copy link to clipboard
Copied
Your request implies a few fundamental bricks such as :
- loading CSV data (given you can't load EXCEL by default)
- Adding frames to a page (the scripting guide is full of samples)
So start exporting EXCEL to CSV, then look around for loading CSV. Come back then with a snippet of yours we can comment.
Copy link to clipboard
Copied
OK, so far so good. I exported from Excel to CSV and loaded into Indesign, as I flipped through the pages and the values changed as hoped. Any thoughts on how to take this information and make boxes/ frames?
Thanks in advance,
John
Copy link to clipboard
Copied
Hm, who marked this answer as correct?
First of all, your screenshot shows not the same as you wrote in your text. So your example is not really clear.
If someone write a script for you, he spent his time for you. While this is interesting sometimes (to learn how to doing things), it cannot be done every time for nothing.
So what Loic is trying to say here is:
Start learning scripting and when you have a detailed problem, post your code and you get surely a good answer.
For your problem you get 2 important answers already:
1. Import your CSV-File > You will find a lot of examples here
2. Learn how to create frames in the document
Nevertheless I would assume, that your task will not work, since width and height of a frame does not give you the position of the frame on the page. So your CSV-file should have x/y-coordinates (4 values are needed) instead of width and height. If this is not possible, create frames and move them … to which position? What, if you reach the page margin? What, if you reach the end of your page?
So hopefully you understand, that this can’t be done in 2 minutes 😉
btw: Loic did not say anything about datamerge!
best
Kai
Copy link to clipboard
Copied
Hi
Yes I was surprised myself at two levels. First of all, being scored as correct and second of all about the understanding of my answer but it was possibly me not being clear enough
Anyway, I did intend writing a script that would load the CSV file as a "Database". So you can later loop through every single record and output the expected frame (width, height and contents).
On a second thought, I realize that using datamerge isn't that a bad idea. Well you will still need scripting ion the end but maybe less code for you if you are a newbie. You could place the width and height datamerge tags. Think of applying a specific style.
Then all that remains is a script that would look for those strings (GREP search), resize the parent textframes based on the contents.
FWIW
Loic