Import a Folder Full of Pictures, One Per Page

In an earlier article, I wrote about how to import lots of images into InDesign at the same time. Later someone asked me how to import a folder of images so that each image shows up on a different page — much like the PDFplacer script (or PlaceMultiPagePDF.jsx script) splits up pages of a PDF so that each page shows up on its own InDesign page.

Here’s a pretty quick two-step process for how to import all a whole folder of images into InDesign quickly, using two features which sound advanced but are really pretty easy.

Setup

Before you start, though, you need to download and install a script called ImagesToCSV.jsx (written by Loic Aigon). If you don’t know how, then here’s how to install a script in InDesign.

Also, you should open a new InDesign document and create a graphic frame on the first page. This can be any size; it is the “template” into which all your images will get placed (one on each page). You might want to create and apply an object style to this frame in the Object Styles panel. (That way, you could edit that object style later and all the image frames throughout the document would get updated at the same time.)

1. Create the List of Images

When you double-click on the ImagesToCSV.jsx script inside the Scripts panel, it’ll ask you to select a folder. Navigate into the folder (so that you can see a grayed out list of the images you want to import) and then click the Open button. It will seem like nothing happened, but the script very quickly writes a csv file (“comma separated” text, similar to what you might export from Excel or a database) which contains a list of all the names of the files and their paths. The path describes where InDesign can find those images — what folder they’re in.

2. Import with Data Merge

Next, open the Data Merge panel (Window > Utilities > Data Merge), choose Select Data Source from the panel menu, and choose that CSV file (it’s in the same folder as the images you want to import).

Select the graphic frame you created on the page, and then click on the word “images” in the Data Merge panel. That tags the frame with that data “label.”

data merge with images

Finally, select Create Merged Document from the Data Merge panel menu (or click the button at the bottom right of the panel). The Create Merged Document dialog box lets you specify which images you want to import (for example, you might want to try importing just 10 out of 1000, just to make sure it’s working correctly).

Folderimages2

If you click the Options tab, you can tell InDesign how to fit the images into the frame. If you want to ensure the image is completely visible on the page (so that no part gets cropped out), choose Fit Images Proportionally from the Fitting pop-up menu.

Folderimages3

When you’re ready, click OK and InDesign creates a new document with the images!

Folderimages4

This sounds like a long process, but believe me, after you do it once or twice it goes extremely quickly and you can import hundreds of images in less than a minute.

Of course, if you need labels with the images, you could use Data Merge for that, too, or (probably easier) use the Live Captions feature. Just set all that up in the original template document.

Bookmark
Please login to bookmark Close

This article was last modified on December 30, 2021

Comments (68)

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. awad alsayed
    August 6, 2024

    great script…. thanks very much .. Mr.daviad

  2. Thom
    August 16, 2023

    Thanks for the script and the support.

    I’m having an issue where the portrait JPGs are coming in rotated to landscape. If I place these JPG manually in InDesign, they appear portrait. I’ve tried different fill options in Data Merge as well as trying to set the fill option on the graphic element on the page.

    Also, by any random chance: Is there a way to have one portrait image on a page, but two landscape images?

    Thanks again!

    1. Thom
      August 16, 2023

      Ok.. more noodling around: These are JPGs straight from a cell phone. If I open and save the images in Photoshop or even IrfanView, they Data Merge properly.

  3. Bryan Alexander
    April 11, 2022

    I’m tying to run the script ImagesToCSV.jsx you shared, but I get a javascript error:

    JavaScript Error!
    Error Number: 8
    Error String: Syntax error
    Engine: main
    File: / Applications/Adobe InDesign 2022/Scripts/Scripts Panel/
    ImagetoCSV.jsx
    Line: 1
    Source: (rtf1ansiansicpq1252 cocoartf2638
    Offending Text: I

    Any idea on what to do? Thanks in advance!!

    1. David Blatner
      April 12, 2022

      Something seems very wrong with that error code… line 1? Seems like the script may be messed up. Maybe try downloading again and make sure it’s saved properly?

  4. Mark Phillips
    March 5, 2022

    Hi
    This script is really handy
    Is there a version available which includes subfolders?
    Or is anyone skilled enough to write the additional javascript perhaps?

  5. Jason Duffield
    June 18, 2019

    Thank you immensely!!

  6. Ernesto
    May 28, 2019

    Awesome!, thank you so much for sharing your knowledge. Greetings from Peru

  7. sol
    January 13, 2018

    Thanks, I will check it out!

    It’s just confusing because the script seems to only create right-hand pages (rectos) in the document but no versos…? Like they don’t show up in the pages panel, nor in the document, obviously.

    Anyhow, thanks, I will try your methods out. =]

  8. sol
    January 11, 2018

    Thanks, this is great! Now how can I make this work across spreads (as in one image per page, set up as spreads/facing pages) instead of creating one side of a double-page spread? My document is set up with facing pages, so I don’t know what the problem is… Thanks!

    1. January 13, 2018

      Doing Data Merge on facing pages is a real problem – Data Merge was designed to work on only 1 page (the right one). I came up with some fairly kludgy Scripts that solve the problem. You can check them out over here:

      https://www.davehennessey.com/computerjunk/indd/index.html

      I’ve several projects where ImagesToCSV saved me dozens of hours of work. Jqcky and Sol’s comments got me thinking – Javascript is the Duct Tape of the computer world. Can it solve this problem? My solutions are not terribly elegant, but hopefully they will save other folks some work. Dave

      1. Dave
        February 10, 2018

        Rosco,

        I can’t quite duplicate your alignment problem. I’m pretty sure that whatever you set on the DataMerge Options tab overrules whatever you set on the individual placeholders. I suggest playing around with the different settings on the DataMerge Options tab, and make sure “Center in Frame” is un-checked.

      2. rosco mac
        February 9, 2018

        Hi Dave – just used your script for facing pages and it works well! One issue I’m having though is I need a slightly different image frame alignment for each side. I’m doing fit images proportionally, so the images don’t fill the entire frame, and on the verso side i want them to aligned upper left, and on the recto side, upper right. I set these alignments in the placeholder frames before doing the merge, but after doing merging, it shuffles the recto/verso pages when it recombines them after deleting duplicates, so many of the alignments are wrong. Any ideas how to remedy this?
        Thank you! other than that script works great – thanks so much!

  9. November 6, 2017

    How to place a folder of image in frames across the two page

  10. Sébastien
    October 22, 2017

    Thanks a lot, this worked perfectly!

  11. Masood Ahmad
    May 25, 2017

    Is there any script which can place multiple PDFs from a given folder.

    1. gamouning
      May 25, 2017

      Hi Masood,

      Take a look at Zanelli Releases MultiPageImporter for Importing both PDF and INDD Files available from this link:

      https://creativepro.com/zanelli-releases-multipageimporter-for-importing-both-pdf-and-indd-files.php

      Good luck!
      -Greg

      1. Masood Ahmad
        May 25, 2017

        Hi Gamouning, I think I was unable to explain my requirements. I already have this MultiPageImporter script with me.

        What I want is, let’s say there are 20 PDFs in a folder, so is there any script or process by which I can place all the 20 PDFs in an InDesign file one by one.

        Moreover, this “runscript.jsx” is used to search/run the scripts. It acts as a centralized location for your scripts.

      2. gamouning
        May 25, 2017

        … and this script may help if you have multiple PDFs inside a folder:

        https://www.kahrel.plus.com/indesign/runscript.html

  12. giulia
    April 26, 2017

    this plugin is so handy!
    but does any of you experience any problem with the order of the pages? eventhough the name of the original files shouldn’t create any problem (image01, image02 and so on) the CSV file messes them up.

    Any ideas how to solve this?

    1. giulia
      April 26, 2017

      I found out by myself, looks like a bug.
      If I work in a folder on the desktop I have no problem with the order of the pages.
      (I’ve literaly copy pasted the same files from a folder on the server to a folder on the desktop and it worked)

  13. Colin
    March 8, 2017

    When do you think indd will have ‘a batch-file’ option already embedded? I have CS6.
    This is my third attempt to d/l and set up the jsx file and import photos. But none of this works.
    Frustrating.
    A simple link to batch file a folder would be easier. as with cmd+d.
    I had to duplicate each frame then click.paste each photo into each frame.
    I also tried the object styles to add text, Nup.
    Master frame text didn’t work either.
    Will CS7 have it?
    Frustrated.

  14. March 8, 2017

    Why does count-all-text.jsx download and not ImagesToCSV.jsx ?

    1. gamouning
      March 8, 2017

      Colin,

      Try hovering of the link and choose SaveAs instead of double-clicking on the link. When I use SaveAs I can choose were to save the file. However, when I click on this link the contents of the script is displayed on the screen. Please note, once you see the contents you can copy/paste into a Text editor of choice and SaveAs ImagestoCSV.jsx.

      1. Colin
        March 8, 2017

        Many thanks. Really appreciate your time and efforts!

  15. November 2, 2016

    So ive got everything working execept my image all import horizontally when they should be vertical. Ive tried changing the configuration in the original images but the final result in indesign is the same.

    1. rosco mac
      February 9, 2018

      Hey Ted – did anyone ever answer you and/or did you ever find a way to fix your problem? I’m having the same issue…

  16. September 8, 2016

    Hi there!
    Great script – is it possible to set the import to place ex. four images per page?

    1. Dave Hennessey
      September 8, 2016

      Yes. Just layout your document with four graphic frames on a page. Then in Create Merged Document (Step 2), change Records Per Document Page to “Multiple Records”, and voila…

  17. August 14, 2016

    You saved my day! i needed to make a batch of pages with bar-codes on them, and i had a folder with the bar codes as .png, and i didn’t have a clue how to make pages, so that every page has a separate code!

    Thanks a million, and keep it up!!!

  18. June 30, 2016

    Hi, thanks for this, it works perfectly.
    Maybe you can help me with one thing though: I have facing pages, and the frame on each page should not be located in the same place (I mean, I have a differently placed frame in each page). If I select both frames, the data merge just repeats each image for both frames… Any ideas?

    1. Moshe Friedman
      August 14, 2016

      Maybe try not using facing pages, (document setup> uncheck “facing pages”)

  19. Jim
    June 12, 2016

    posted this earlier:
    “no luck here either. I tried placing 187 then down to 10 psd files and what it did was it created 5 open indesign files with one photo each on the first page…”

    now i tried it again only this time i created a new indesign document with a single page only. and it worked. the article mentioned: “Also, you should open a new InDesign document and create a graphic frame on the FIRST PAGE….” so i thought i should open a multiple page document.

  20. April 1, 2016

    Thanks for that awesome tutorial!
    I have the following problem with it: I have a document with two object frames on each page. The upper frame should show picture 001 to 070 (one on each page), the lower one picture 071 to 140. I can import the pictures in either the upper or the lower frame without any problems but if I try to add both in one document, it only inserts 1 picture and then stops.
    Any recomandations or work-around? Thanks!

  21. Charles Lattam
    February 5, 2016

    Thanx. This was exactly what I needed, but I am riddled with a strange phenomenon. I tried some image folders where it worked but strangely it does not work with a book I had photographed. They are all jpegs and nothing special but the script only creates empty frames. I tried it many times.. Has anyone experienced such a problem yet? Thank you very much for your support.

  22. December 11, 2015

    In my case I am already using data merge for other information, when you already have data merge source files brought in to your document you get a warning message when trying to select another source, that in may invalidate the current data merge source. I am planning to use the multipageimporter2.5jjb.jsx script found in another post (https://creativepro.com/zanelli-releases-multipageimporter-for-importing-both-pdf-and-indd-files.php) by creating one .pdf of all my image files in acrobat. By doing so, you could avoid the data merge all together. All you need is acrobat pro. create, combine files into single .pdf. then use script.

  23. V
    December 10, 2015

    Nice work,

    Is there a way to save the Create Merge Document Settigns, in order to reuse it ?

  24. Eugene Tyson
    November 11, 2015

    CC2015 – YOSEMITE – This script only produces 1 line of the folder of images, and image 70 nonetheless.

    Tried back to CC14 and still no luck.

    1. Jim
      June 12, 2016

      no luck here either. I tried placing 187 then down to 10 psd files and what it did was it created 5 open indesign files with one photo each on the first page…

  25. November 10, 2015

    Works perfectly! Saved me many hours of boring manual labor.

    CS2 oddity – when you click on the text frame in Step 2 – you don’t get the word “images” just a dot in the middle of the text frame. Just continue on – it works fine.

    Thank You Very Much!

  26. Karlu Tayabas
    October 21, 2015

    It seems that this script won’t work on .tif and .psd files or am I wrong?

    1. Greg Mouning
      November 10, 2015

      Karlu,

      As far as I know this script works with any image recognized by InDesign. This includes .tif and .psd. Can you “Place” your image into InDesign?

  27. Greg Mouning
    October 13, 2015

    Thomas,

    What I find helpful is to number images as 001, 010 thru 516. As in File001, File010, thru, File516. By adding the extra zeros in front of the single and double digits numbers, you should be able to sort in the order you need.

    Hope that is helpful in your situation too.

    -Greg

    1. November 10, 2015

      I’ve been doing a lot of scanning lately, and need to change dozens/hundreds of file names – like changing scan0123.jpg to page-001.jpg etc.

      I found the program “Bulk Rename Utility” the most wonderful thing in the world for renaming files. It’s got so many options that you can do whatever your little heart desires. https://www.bulkrenameutility.co.uk

  28. Reza
    June 3, 2015

    This is tremendously helpful. I am having trouble repeating this process for a different set of pictures. That is, I have two directories of images and want to place correspond pairs on the same page. When I choose a new data source, the process replaces the previous pictures. Is there a way to assign different data sources to different frames?

    1. Greg Mouning
      June 3, 2015

      Hi Reza,

      If I understand you correctly, you need to make sure you run the ImagesToCSV.jsx on both directories. This will generate (2) csv files with links for each image. Next you can use a txt editor to combine (copy/paste) the records you want to use in your merge into a new csv file. Finally, you use that new csv file to run your data merge.

      Hope that helps!

      -Greg

      1. Thomas von Liptak
        October 14, 2015

        Thank you Greg,
        That was the solution, three digits for all numbers 001-516.
        Thomas

      2. Thomas von Liptak
        October 13, 2015

        Works great, except I have a folder with 516 jpeg´s numbered 1-516.
        They need to be placed one on each page in sequence, but the .csv file won´t sort in the correct order. Like 399-400-4-401 and so on.
        Any clues as to fix it ? Thanks

  29. Dave
    November 17, 2014

    Thanks. That worked a treat!

  30. Ryan
    November 4, 2014

    Is it possible to use a similar script to put unique text at the bottom of every spread? For example, I am creating a workbook and need to put a unique quote at the bottom of every page. I would like to create the text holder on the master page and data merge 100 unique quotes (from a CSV file) to the bottom of one page on every spread. Thanks!

    1. Becca
      June 16, 2015

      Did you ever get a response?
      …or maybe you can help…I’m trying to copy/paste word into InDesign but through-text creates all new page run.

  31. Eugene Tyson
    October 13, 2014

    Brilliant! Found this useful this morning!

  32. adam
    September 25, 2014

    Thank YOU! It worked! Simple and effective. I did it in CS6

  33. Adrian Apodaca
    August 15, 2014

    AWESOME. You just saved me several hours of work!!!!

  34. August 14, 2014

    Can I change to facing pages after the script has done it’s thing?

  35. tim
    May 23, 2014

    Great tutorial!
    Is there a way when exporting jpegs of the different pages, to keep the original filename of the initial jpeg name?

    Example: I place the jpeg with name “test1.jpeg” on a page. Can I export it from indesign automatically as a jpeg with the name “test1.jpg?

    thanks in advance,T

  36. Dominik
    April 21, 2014

    works perfect!
    good job, thanks!

    d.

  37. Lauren
    January 13, 2014

    I’m trying this but the .csv has duplicates in the list.

  38. Maria Clara
    October 25, 2013

    Great post, but I have a doubt… You said “InDesign creates a new document with the images”. It’s possible place images sequence in the same document? I am testing this tutorial with an archive of 300 pages/images, but It’s too slow… My aim is to apply the images in a document that already has others layers, is this the correct procedure? thank you!

    1. Carlo Notarianni
      September 4, 2015

      Another problem is: when InDesign creates a new document, assigns it the default size. If, instead, as we wish, use the current document, so you can simply create a new document and run the script.
      To make sure that the script does not create a new document must change the line 237.
      Change line 237 of script (make a backup first, just in case)
      From:
      var myDocument = app.documents.add();
      To:
      var myDocument = app.documents[0];

      Personally I duplicated the script and changed the line. Now the modified script works as I want!

      1. Bruno
        February 24, 2016

        Well, I put back “myNumberOfPages” on line 264 (instead of a fixed number) and now the modified script works well, no more reported error. Very weird… Sorry for my previous post and thanx again for the trick.

      2. Bruno
        February 23, 2016

        Thanks Carlo, I did this, but then I got an error on line 264. In order it worked, I had to replace “myNumberOfPages” by the actual number of pages that I needed.
        But I’d like to make it automatic (i.e. without having to modify the script each time I use it), and if you know how to do that, many thanks in advance !

  39. September 1, 2013

    There is a script produced by Austrian Scripter Roland Dreger that is solely for this purpose – https://www.rolanddreger.net/index.php?id=310 (site is in German)

  40. amnon zamir design studio Ltd
    June 15, 2013

    great trick. works swiftly. kudos to Loic!

  41. mahony
    June 14, 2013

    You also might want to checkout makeAPhotoBook.jsx by Roland Dreger:
    https://www.rolanddreger.net/index.php?id=302

  42. Greg Mouning
    June 10, 2013

    FYI, this also works using the Imagecatalog.jsx script. Just set Number of Rows and Columns to 1.

    1. Rombout Versluijs
      June 28, 2018

      You cant set a page and do almost nothing with that one.

    2. June 11, 2013

      Greg: Brilliant. Simple. Thank you!

      That said, the technique I discuss does have a couple of advantages: You can set an object style, the size and position of the frame, and add other elements on the page (text frames, background color, and so on).