The visually heavy nature of many InDesign projects require working with a wide range of photos. In some cases, importing a folder full of pictures, with one picture per page, is a necessary part of the project. Learn how to write an InDesign script to import these picture and place them on each page.
Somebody asked me recently, how do I'm import a folder full of images so that each image shows up on a different page? Well, InDesign can do this, but you have to use a script. Actually, I'm going to show you two different scripts that do similar things. Don't be scared fo the word script, they're really easy to use. Because I'll be using scripts, I need the Scripts panel, and I can find that if I go to the Window menu, go down to the Utilities submenu, and then choose Scripts. Now, InDesign Scripts panel has two different folders in it, Application and User.
We're going to start off by looking inside the Application folder, and I can look in there by just clicking on that little triangle next to the folder. That expands so that I can see that there's a script in there and also a folder full of samples. If I open the Samples folder and then and then open the JavaScript folder, I can see a bunch of scripts in here. That's all the things with the .jsx extension. Now, I'm going to scroll down until I find the ImageCatalog script, there it is. Running a script is really easy. All you have to do is double-click on it, and when I double-click on this script up comes a dialogue box that says, what folder has the images that you're trying to import? I'll select this Images folder that's up on my desktop and click Open.
The script tells me that there are 16 images inside this folder and it's going to import all of them. It can lay these images out as a grid on the page, but remember what we're trying to do is have one image per page. So, I'm going to set the rows and columns to both one. Just one row, one column, with just one image per page. The fitting area lets me tell this script let's me tell this script how I want to scale the images inside the frame. In this case, I want to scale the images up to fit the frame and make sure that the frame fits the content, so the frame and the images are the same size.
I even have an opportunity to turn on labels. For example, I can have each image have the file name, the file path, or XMP metadata from inside the image. In this case, I don't even want to have any of those things, so I'm going to turn off the Labels checkbox. I just want the images. Now, we're ready to import, so I click OK and InDesign builds a page and imports all of the images, one image per page. It's done. It just takes a few seconds. I'll click OK, open the Pages panel, and you can see we now have 16 different pages, each one with a different image.
So, the ImageCatalog script is one great way to import a bunch of images very quickly, but there are a couple of problems with it. For example, you have no way of controlling how large the frame should be on each page. Another problem is you can't design the page. Maybe I wanted to have a background behind all of these, or maybe I wanted to put some other information about the artist on every page. So, I'm going to show you one more technique, which is a little bit more complex but it gives you all kinds of other options. First, I'm going to close this document, because I don't need it anymore, and I don't need to save that.
Second, I need to install a new script. Now this script does not ship with InDesign, this is one that you have to download from the Internet. You can find it here at indesignsecrets.com, in their article called, Import a Folder Full of Pictures, One Per Page. When you download that script, it's going to be downloaded to your Downloads folder as a .jsx file, and then you can import it into your Scripts panel. Now, I've already downloaded that script and it's sitting in my Downloads folder. I'll switch back to InDesign. I'm going to go to the top of my Scripts panel and close my Application folder because I'm going to put my script, my new script that I downloaded, into the User folder.
To put a script inside my User folder, all I need to do is right-click on that folder or Ctrl+click with a one button mouse, and choose reveal in Finder. On Windows, it would be Reveal in Windows Explorer. Suddenly, I see the folder called Scripts, and inside Scripts, there's a folder called Scripts Panel. Any script that you put inside the Scripts Panel folder will show up in the panel. It's as easy as that. So, here's the script that I downloaded, and all I need to do is drag it into the Scripts Panel. If I open the Scripts Panel, I can see the script there.
I also notice something wrong, and that is, the script has a .txt at the end. It's suppose to be just .jsx, so I need to edit this to get rid of that .txt. Yes, I am sure that I want to use .jsx, there we go. So, I have now installed a script into the Scripts panel, and if I go back to InDesign, I can see it right there inside the User folder. All I have to do is click that little triangle and there it is. You don't have to restart InDesign or anything like that. All right, so that's the first step, now I need to run this script.
In order to run this script, I have to have a document open. So, I'll just go to the File menu, choose New > Document, and then click OK. Now, I'll double-click on the script to run it and InDesign asks me the same thing. What folder do you want to use? So, I'm going to choose Images and click Open. It doesn't appear that anything happened at all because all this script does, is it writes a little text file inside that folder. It's a .csv file. That's a comma separated data file, similar to the kind of thing that you would export from Excel or a database.
I ran that script because I need that CSV file in order to import the images using this other technique. The technique uses data merge. So, I'm going to open the Data Merge panel, which I find here grouped with the Scripts panel. If it weren't grouped with that panel, all I'd have to do is go to the Window menu, choose Utilities and then choose Data Merge. Now, data merge lets me import data, and the data that I'm trying to import is those images. So, I'm going to go to the Data Merge pop-up menu, this little fly out menu at the top, say,Select Data Source.
Now, I'm going to navigate inside the Images folder. And I can see, down at the bottom, here's the images.csv file that, that script created for me. The script went through and made this CSV file that describes where each one of these images are inside this folder. I'll click Open, and you can see that the CSV file has two bits of data, the Name and the Images. All I have to do now, is give myself a graphic frame and click on Images. Now, because of that CSV file, InDesign knows where the image is and I've told it where to put the image, inside this frame.
I'll go back to my selection tool because I want to do one more thing that's really important at this point, and that is to give this an object style. I'll open my Object Styles panel and say, give me a New Object Style, and I'll give it a name, I'll call this image frame. It doesn't matter what you call it, and really, it doesn't matter what you set this up as right now, because later on we can change it to anything we want. Let's go ahead and click OK, and then click on the object style to assign that object style to this frame. If I want to test this to make sure the image is going to go into the right place, I can do that by turning on the Preview checkbox.
As soon as I do that, you'll see that InDesign places the first piece of data, that first image, inside the frame. Now, I can move through them one at a time by clicking on these little arrow buttons. But, when I'm done previewing and I really want to import all these images, all I have to do is click over here in this right side button called Create Merge Document. Here, I can control which images are going to be brought in. In this case, I want all of them. And then if I click the Options tab at the top, I can tell InDesign what to do about the images, how to fit them to the frame.
Right now I have them set to Fit Images Proportionally, but if I wanted to make that the image fills the whole frame, I could chose Fill Frames Proportionally instead. That's all the set up I need to do. To import the images, I click OK and InDesign creates a new document based on this template, and it fills all of those frames with the images. It only takes a few seconds, even if you have dozens of images or even hundreds of images. And it tells me that no overset text was generated. That's okay, because there was no text in here at all anyway, it was just graphics.
So, I'll click OK. I'll move the panel out of the way and we can see that in the Pages panel, we have a similar thing, 16 different pages and each one has an image in it. I'm just double-clicking on those to move from one page to the next. Once again, the benefit of using Data Merge is that we have a lot of control about where the images are, how large the frames are and we can use those object styles. So, if I go back to my Object Styles panel, I can right-click or Ctrl+click with a one-button mouse, on the image frame and then edit it.
So, I could say, let's go ahead and give this a stroke perhaps. Let's give it a black stroke, let's make it really thick, and we can put a special type around it, like thick thin. And then let's set the gap color to paper. Click OK, and you'll see that now all of these have a special frame around them. I'll just press Shift+Page Down, to go from one to the next. Now, I know this second technique, this data merge technique, seems like a long process, running the script and running data merge and so on. But, believe me, after you do it once or twice, it actually goes extremely quickly and you can import hundreds of images in less than a minute.
Updated
12/5/2019Released
8/25/2011New techniques will be added to the collection every other week, so check back early and often. Find more tips and tricks at indesignsecrets.com.Note: Because this is an ongoing series, viewers will not receive a certificate of completion.
Skill Level Intermediate
Duration
Views
Q: Why can't I earn a Certificate of Completion for this course?
A: We publish a new tutorial or tutorials for this course on a regular basis. We are unable to offer a Certificate of Completion because it is an ever-evolving course that is not designed to be completed. Check back often for new movies.
Related Courses
-
InDesign CC 2018 Essential Training
with David Blatner6h 30m Beginner -
InDesign: Interactive PDFs
with David Blatner2h 27m Intermediate -
InDesign CC 2018: EPUB
with Anne-Marie Concepción4h 35m Intermediate -
InDesign CC 2019 Essential Training
with David Blatner5h 23m Beginner -
InDesign Quick Start
with David Blatner22m Beginner
-
This Week's Secret
-
Introduction
-
Welcome to InDesign Secrets1m 10s
-
-
November 2019
-
October 2019
-
409 Copy and paste effects4m 39s
-
-
September 2019
-
408 The master page trick1m 46s
-
August 2019
-
July 2019
-
June 2019
-
May 2019
-
April 2019
-
October 2011
-
August 2011
-
September 2011
-
March 2019
-
February 2019
-
376 Make cast shadows3m 35s
-
-
January 2019
-
November 2018
-
December 2018
-
369 Shared CC Libraries tips5m 15s
-
October 2018
-
360 Find spacing problems4m 50s
-
363 Export all text8m 16s
-
-
August 2018
-
351 Change default fonts5m 51s
-
352 Best default RGB4m 45s
-
-
September 2018
-
July 2018
-
May 2018
-
343 Border spacing fix4m 59s
-
June 2018
-
346 Export to HTML55m 38s
-
April 2018
-
February 2018
-
March 2018
-
January 2018
-
325 Link text frames6m 10s
-
December 2017
-
November 2017
-
September 2017
-
October 2017
-
313 Quick Apply preferences6m 35s
-
August 2017
-
July 2017
-
May 2017
-
290 Work with scripts3m 35s
-
June 2017
-
April 2017
-
286 How to format ellipses5m 39s
-
March 2017
-
281 Share a CC library7m 10s
-
January 2017
-
February 2017
-
December 2016
-
271 Add images to an index4m 39s
-
November 2016
-
September 2016
-
October 2016
-
260 Batch process images7m 33s
-
263 Sync master pages5m 51s
-
-
August 2016
-
July 2016
-
June 2016
-
April 2016
-
May 2016
-
240 Side-by-side tables5m 35s
-
March 2016
-
February 2016
-
228 Setting text at an angle6m 24s
-
December 2015
-
January 2016
-
222 Adding paragraph shading1m 50s
-
October 2015
-
November 2015
-
September 2015
-
July 2015
-
August 2015
-
204 Creating a8m 14s
-
205 Managing scripts5m 38s
-
May 2015
-
189 Placing InDesign files5m 14s
-
-
June 2015
-
193 Printing tracked changes5m 41s
-
-
April 2015
-
186 Making long shadows5m 41s
-
February 2015
-
March 2015
-
January 2015
-
December 2014
-
November 2014
-
October 2014
-
September 2014
-
August 2014
-
July 2014
-
148 Cropping with paste into5m 18s
-
-
June 2014
-
May 2014
-
141 Inserting glyphs6m 42s
-
April 2014
-
March 2014
-
February 2014
-
January 2014
-
December 2013
-
November 2013
-
October 2013
-
September 2013
-
August 2013
-
105 Working with MiniBridge5m 45s
-
106 Customize your QR codes6m 17s
-
July 2013
-
June 2013
-
May 2013
-
April 2013
-
March 2013
-
February 2013
-
December 2012
-
069 Ten uses of the Story Editor11m 39s
-
-
January 2013
-
November 2012
-
October 2012
-
061 Embedding images7m 44s
-
-
September 2012
-
057 Text wrapping6m 54s
-
-
August 2012
-
July 2012
-
June 2012