is now part of CreativePro.com!

Import a Folder Full of Pictures, One Per Page

67

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.

David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, CreativePro Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at LinkedIn Learning (Lynda.com) are among the most watched InDesign training in the world.
You can find more about David at 63p.com

Follow on LinkedIn here
  • Greg Mouning says:

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

    • 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).

    • Rombout Versluijs says:

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

  • mahony says:

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

  • amnon zamir design studio Ltd says:

    great trick. works swiftly. kudos to Loic!

  • 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)

  • Maria Clara says:

    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!

    • Carlo Notarianni says:

      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!

      • Bruno says:

        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 !

      • Bruno says:

        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.

  • Lauren says:

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

  • Dominik says:

    works perfect!
    good job, thanks!

    d.

  • tim says:

    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

  • Simon says:

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

  • Adrian Apodaca says:

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

  • adam says:

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

  • Eugene Tyson says:

    Brilliant! Found this useful this morning!

  • Ryan says:

    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!

    • Becca says:

      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.

  • Dave says:

    Thanks. That worked a treat!

  • Reza says:

    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?

    • Greg Mouning says:

      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

      • Thomas von Liptak says:

        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

      • Thomas von Liptak says:

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

  • Greg Mouning says:

    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

    • 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

  • Karlu Tayabas says:

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

    • Greg Mouning says:

      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?

  • 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!

  • Eugene Tyson says:

    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.

    • Jim says:

      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…

  • V says:

    Nice work,

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

  • Brian says:

    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.

  • Charles Lattam says:

    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.

  • 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!

  • Jim says:

    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.

  • Nicole says:

    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?

  • 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!!!

  • Jeppe says:

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

    • Dave Hennessey says:

      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…

  • ted says:

    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.

    • rosco mac says:

      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…

  • Colin says:

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

    • gamouning says:

      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.

  • Colin says:

    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.

  • giulia says:

    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?

    • giulia says:

      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)

  • Masood Ahmad says:

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

  • Sébastien says:

    Thanks a lot, this worked perfectly!

  • Jqcky says:

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

  • sol says:

    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!

    • 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

      • rosco mac says:

        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!

      • Dave says:

        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.

  • sol says:

    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. =]

  • Ernesto says:

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

  • Jason Duffield says:

    Thank you immensely!!

  • Mark Phillips says:

    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?

  • Bryan Alexander says:

    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!!

    • David Blatner says:

      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?

  • Thom says:

    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!

    • Thom says:

      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.

  • >