AppleScript nd adobe indesign

I have a bunch of images sized 540px on the long side (some portrait, some landscape). The other side could be any size, but will be less than 540. There are no square images.

I want to be able to choose a folder containing the images, and want the script to do the following for each image:

Place it at the center of the current page of the active indesign document. Scrape the filename from the image (without the extension), apply the pre-existing Paragraph Style 'Caption' to the text, and center the text 36 points (not pixels) below the image.

Group the image and the text.

Then create a frame with white fill, 540x600 pixels in size, send it to back, center it with the group created above, and group them.

I've been pulling my hair out. Just can't get it to work.

AppleScript nd adobe indesign
 
 
Q