Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Auto import hundreds of images

Return to Member Forum

  • Author
    Posts
    • #60532
      Matt Mayerchak
      Participant

      Hi – I'm looking for a script or plugin to import hundreds of images into an Indesign file. One image per page at 100% size, placed into the master margin guides on otherwise blank pages.

      I know I can load the cursor with all of them but with hundreds to do, and several of these projects, it would still help to have a script. Does anyone know of such a script?

      The images are numbered sequentially but there is nothing in the Indesign file to tag them to at the moment.

      I searched and didn't find any other topics that exactly addressed this – there were a few about catalog importing but they were more complicated. If I missed an existing thread, please direct me to it.

      Thanks for the help!

    • #60806

      I'm looking the same type of script. Is it possible to create one?

    • #60845

      This will KIND OF do what you want…

      https://www.scriptopedia.org/in…..ToCSV.html

      Make a single non-facing page. Run this script. From here, the user will be prompted to navigate to a folder where the pictures reside. Once confirmed and OK'd, the pictures are put into a datamerge database. From here, make a picture frame the size of the page and put the datamerge picture placeholder into that frame. Now create a merged document and voila, one image per page at 100% size.

      hope this helps.

    • #60851
      Anonymous
      Inactive
    • #60855
      Matt Mayerchak
      Participant

      Eugene – you're right, that should work. Thanks!

      I've done lots of data merging but hadn't done images so I was less familiar with that part of it.

      Thanks for the help.

    • #60856
      Anonymous
      Inactive

      Yeh it should work.

      Not really sure how you get all the paths into the Excel file, I've never done it myself.

      If you find a streamlined way , or whatever process can you post it here?

    • #60862
      Amy Gilbert
      Participant

      If you are on a Mac, you can copy/paste the files from Finder right into Excel. That'll give you filenames. If your ID file, Excel file and images are in the same directory, I don't think you'll need the full path – but there's a way to do that too with some Excel and Word tricks.

      If you are on a PC, at a DOS prompt type

      dir > filename.txt

      from the directory where all the files reside. This will give you the file names with a lot of other garbage you don't need, but it is a fixed width text file so when you bring it in to excel, choose “fixed width” in the Text Import dialog and when you click “Next” you'll be able to set up your columns so that one column is just the file name. Then you can delete the rest.

    • #60865
      Matt Mayerchak
      Participant

      I'm sure there are lots of Mac utilities that will generate the pathnames of files. Probably some free ones.

      One I already own is A Better Finder Rename 8 (costs $19.95 – https://www.publicspace.net/ABe…..erRename/). You can drag/drop all the image files into the window as if you're going to rename them, but don't change them to anything. There's a button at the bottom for saving the file list and an option to include the full path name. It generates a text file.

      Once you have the text list with path names, if you don't have any other fields – i.e. your mailmerge is only for the images – you don't need to use Excel to make a comma-delimited or tab-delimited file. You already have what you need.

    • #60870

      (Looks around) We're in the Scripting forum, right?

      someFolder = Folder.selectDialog (“Choose a Folder”);
      if (someFolder != null)
      {
      filenameList = [];
      fileList = someFolder.getFiles( function(x) { return x instanceof File && !x.hidden; } );

      if (fileList.length > 0)
      {
      writeFile = File.saveDialog( 'Save File As:' )
      if (writeFile != null)
      {
      if (writeFile.open(“w”))
      {
      for (i=0; i<fileList.length; i++)
      writeFile.write (fileList[i].fsName+”r”);
      writeFile.close();
      } else
      alert (“unable to create file “+writeFile.fsName);
      }

      } else
      alert (“No files found in “+someFolder.fsName);

      }

    • #60873

      Jongware, how did you post the code with the 'Select code' button?

    • #60875

      Trial and error :)

      The forum editor is picky when accepting formatting code, so I switch to HTML view and insert this manually:

      … your code comes here
      remember to escape &, < and >
      (as well as the usual \ to get )

      If I remember correctly you have to be very careful when post-editing.

    • #60882

      Huh — only now I notice the editor is smarter than I am!

      This is the HTML code you need to insert:

      {pre}{code}

      .. your script comes here

      {/code}{/pre}

      And of course you need to replace the curly braces with <..>

      It seems the editor not only doesn't like backslashes (as you have noticed elsewhere :) ) but also agressively interprets anything that looks like HTML.

    • #60884

      Thanks, Jongware.

      Before I tried to use pre-tags to enclose code in HTML editor, but this had no effect. Now I see that I should use code-tag inside pre-tag.

    • #60936

      .fsName+"r"


      Hi, Jongware!

      .fsName+”r” should be .fsName+”r”. Somehow your blackslash was dropped by the forum software?

      Uwe

      Edit: mine, too…

      So to everyone: just add a backslash before the “r”! Now i try to escape my backslash…

Viewing 13 reply threads
  • You must be logged in to reply to this topic.
Forum Ads