Skip to main content
Steve Straus
Known Participant
January 23, 2015
Answered

Script to place folder of images @ 100%, one image per page?

  • January 23, 2015
  • 1 reply
  • 2094 views

I am looking for a script that can place a folder of images into an ID doc at 100%, one page per image, with image file name below. I have tried various contact sheet scripts but these scale the images to fit the page. I need the images to be placed at 100% so a client can review them at their exact size.

Any help would be very appreciated. Thanks!

This topic has been closed for replies.
Correct answer Chinnadk

Thanks -- I'll give it a try!


Try this,

var doc = app.activeDocument;

var w =doc.documentPreferences.pageWidth;

var h = doc.documentPreferences.pageHeight;

doc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;

var _folder = Folder.selectDialog("Select a folder");

var _files = _folder.getFiles();

for(var i =0;i<_files.length;i++)

{

        if(_files instanceof File)

        {

                var image = doc.pages.item(-1).place(_files);

                var gb = image[0].parent.geometricBounds;

                var imageheight = gb[2] - gb[0];

                var imagewidth = gb[3] - gb[1];

                image[0].parent.geometricBounds = [(h-imageheight)/2,(w-imagewidth)/2,(h-imageheight)/2+imageheight,(w-imagewidth)/2+imagewidth];

                image[0].parent.fit(FitOptions.CONTENT_TO_FRAME)

                doc.pages.add(LocationOptions.AT_END);

            }

    }

doc.pages.item(-1).remove();

Regards,

Chinna

1 reply

Inspiring
January 24, 2015

Hi Steve,

you can try this one

https://vimeo.com/65954216

+

Text variable in document for image name.

Roland

Steve Straus
Known Participant
January 26, 2015

Roland --

What script are you using? I see your video but there is no mention of a script to do this.

Inspiring
January 26, 2015

Oh, sorry, the link under the video is was wrong. Here you can download it: Roland Dreger: Fotobuch mit InDesign