Copy link to clipboard
Copied
Hi I want to automate placing images manually into selected frames.
There is 18 different frames (6) large, (6) medium, (6) small.
Currently I have to manually place the images in these frames from a selected file.
Is there a script or feature that allows me to automate this workflow?
Attached below are images of the template before and after images are placed.
Assuming they are always the same aspect ratio and you have autofitting configured in your template, and placement location doesn't matter, then this should work:
var afs = File.openDialog("Choose all the photos", "*", true);
try { var doc = app.activeDocument; } catch(e) { exit(); }
var apis = doc.allPageItems;
var n = apis.length;
var i = 0;
if (n !== afs.length) { alert("Number of files selected doesn't match rectangles on page. Placing as much as we can."); }
for (i; i < n; i++) {
tr
...
Copy link to clipboard
Copied
I can't help with scripting, though likely someone else can, but do you know you can load all 18 files at one, and then just drop them into the frames, as a regular InDesign feature?
~Barb
Copy link to clipboard
Copied
Hi Barb Thanks for the reply.
Yes I know about this feature however I want to automate the process of placing in the images one by one.
Copy link to clipboard
Copied
Hmmh?
The placement of the 18 images is done with the Place Gun in frames with the automatic adjustment option with 18 clicks in a few seconds. The development of a customised script, on the other hand, could take several hours.
Copy link to clipboard
Copied
Correct, however I'm processing upwards to 10 of these files a day and expecting more.
Copy link to clipboard
Copied
@pixxxelschubser You are referring to the action barb posted above correct?
Copy link to clipboard
Copied
That is correct.
But maybe I'm wrong and misjudge the time required for script creation (I actually script mainly for Illustrator and therefore I'm not the right person for you 😉 ). So let's just wait and see what the InDesign scripters have to say.
If you need to do it quickly, you can always hire a scripter.
Copy link to clipboard
Copied
Assuming they are always the same aspect ratio and you have autofitting configured in your template, and placement location doesn't matter, then this should work:
var afs = File.openDialog("Choose all the photos", "*", true);
try { var doc = app.activeDocument; } catch(e) { exit(); }
var apis = doc.allPageItems;
var n = apis.length;
var i = 0;
if (n !== afs.length) { alert("Number of files selected doesn't match rectangles on page. Placing as much as we can."); }
for (i; i < n; i++) {
try {
apis[i].place(afs[i]);
} catch(e) {}
}
Copy link to clipboard
Copied
Hello Brian thanks for the reply and script.
I'm getting an error running the script. I'm sure its something super simple but I have no Javascript experience.
Copy link to clipboard
Copied
Error was a mistake on my end.
Copy link to clipboard
Copied
I had inserted an extra bracket that I removed on edit after I spotted it. Glad you got it working.
Copy link to clipboard
Copied
Brian's Code works! Thanks appreciate the reply.