3 Replies Latest reply on May 25, 2016 4:56 PM by MrTIFF

    Image script automatically

    Bademesteren


      Greetings! I don't know if you can help, but Iam looking for a way to import one image into multiple frames (different seizes) in indesign.

       

       

      Example: Skolefoto

       

       

      The Images are placed en one big batch, I therfore need a script that picks one image, automatically makes a page and places the image in the boxes and then continues to the next image with the same procedure.

       

       

      Hope my question makes sense:)

       

       

      Kind Regards

      Daniel Kristensen

        • 1. Re: Image script automatically
          Laubender Adobe Community Professional & MVP

          Hi, Daniel!

          There is a script by Gerald Singelmann that can do something like this with prepared pages and graphic frames:

          Place Images by Contextmenu | InDesign FAQ

           

          Uwe

          1 person found this helpful
          • 2. Re: Image script automatically
            [Jongware] Most Valuable Participant

            A bit broad, but here is something to get you started. I assume you have a master page with all of the frames' positions predefined? Just add a bunch of pages, then, and place a photo in any of the frames on each page. Next, select the photo frame and the empty ones and run this script:

             

            srcimageItem = null;
            for (i=0; i<app.selection.length; i++)
            {
              if (app.selection[i].hasOwnProperty("images") &&
                app.selection[i].images.length == 1 &&
                app.selection[i].images[0].itemLink)
              {
                if (srcimageItem)
                {
                  alert ("more than one image, not sure which one to use");
                  exit();
                }
                srcimageItem = app.selection[i].images[0].itemLink;
              }
            }
            if (srcimageItem)
            {
              for (i=0; i<app.selection.length; i++)
              {
                if (app.selection[i].hasOwnProperty("images") &&
                  app.selection[i].images.length == 0)
                {
                  app.selection[i].place (srcimageItem.filePath);
                  app.selection[i].fit (FitOptions.PROPORTIONALLY);
                }
              }
            } else
            {
              alert ("no image in any of these frames?");
            }
            

             

            It locates the original file of the single image and then places this in all other selected frames:

             

            Screen Shot 2016-04-20 at 11.30.05 PM.png

            • 3. Re: Image script automatically
              MrTIFF Level 3

              So you want to produce multiple copies of a photo, at different sizes, on the same Page, for many photos  (as in Jongware's illustration).

               

              I'm imagining that, before the script runs, the photos are all in one folder, and a 1-Page InDesign document has been created, with frames at the desired sizes and locations on the page.

               

              Then when the script is run, it does something like this:

               

              1. Duplicate the first page (and all of its frames) of the document. Make the duplicate page be Page 2.

              2. Place the first image in the image folder into one of the frames of Page 2.

              3. Replicate the image into the other frames of Page 2. (This is the step that is described in Jongware's script.)

               

              4. Duplicate the first page (and all of its frames) again. Make the duplicate page be Page 3.

              5. Place the second image in the image folder into one of the frames of Page 3.

              6. Replicate the image into the other frames of Page 3.

               

              And so on, until all of the images in the image folder have been processed.

               

              Is this more or less what you had in mind?