Sean,
I don't have enough time to write the whole script right now, but here is my idea of how it can be done:
//-------------------------------------------------------
// Places all pictures from the selected folder onto the first
// page of the active document, adds captions, groups pics & captions
// and distributes them vertically
var myDocument = app.activeDocument;
var myGroups = new Array;
var myFolder = Folder.selectDialog("Please select path to files");
if (myFolder!=null) {
var myFiles = myFolder.getFiles();
}
else {
alert("No folder selected");
}
for (var j = myFiles.length - 1; j >= 0; j--) {
var myPic = myDocument.pages[0].place(myFiles , [0, 0], undefined, false, false);
var myPicBounds = myPic[0].parent.geometricBounds;
var myName = myPic[0].itemLink.name;
var myCaption = myDocument.pages[0].textFrames.add();
myCaption.geometricBounds = [
myPicBounds[2],
myPicBounds[1],
myPicBounds[2]+10,
myPicBounds[3]
]
myCaption.contents = myName;
myCaption.paragraphs.everyItem().applyParagraphStyle(myDocument.paragraphStyles.item("[Basic Paragraph]"), true);
var myGroup = app.activeWindow.activeSpread.groups.add([myPic[0].parent, myCaption]);
myGroups.push(myGroup);
}
myDocument.distribute(myGroups, DistributeOptions.VERTICAL_SPACE, AlignDistributeBounds.PAGE_BOUNDS, false);
//-------------------------------------------------------
It's far from perfect – I made it in about 5 minutes – but it can be a starting point for your script.
Kasyan
... View more