How to Code Bulk Image Placement on a Specified Page in InDesign via .jsx or .idjs?
InDesign Coding N00B, here.
Seeking guidance as to practicality and approach to writing .idjs or .jsx code to place ~300 .png image files in an InDesign-based "coffee table book."
- (NB: This is a non-paying job in support of a community not-for-profit fundraiser. No funding.)
BACKGROUND
Using exiftool, each affected .png has been updated with an "xmp-dc:Description" tag that contains the image's caption.
In a single image test via InDesign's PLACE command, InDesign's Caption Setup | Generate Live Caption recognizes and displays the ("Description") Caption just fine.
All images are listed in a .csv that contains:
- The full macOS path of the image, and
- The page number where the image is to be placed. (At the moment, the author just wants each image placed on their designated page...with intentions of manually repositioning & resizing them later.)
Example CSV entries:
- "(/Users/{name}/ ... /coffeetablebook/images/IMAGE1067.png)","42"
- "(/Users/{name}/ ... /coffeetablebook/images/IMAGE1022.png)","84"
- "(/Users/{name}/ ... /coffeetablebook/images/IMAGE1117.png)","7"
REQUEST for YOUR EXPERTISE
Is there a practical way(s) to write a .jsx or .idjs script that can:
- Open the affected .indd file,
- Open the affected .csv file,
- Loop through the .csv file in order to:
- Access each image file via its macOS Path,
- PLACE the accessed image on the specified page,
- Embed the image file link in the .indd,
- Apply a defined Caption Setup to the properly placed image,
- Activate Generate Live Caption for the properly placed image, then
- When done looping through the .csv: close the .indd and exit InDesign?
IDEAL for AUTOMATION? Or...?
If the above process is ideal for automation (.idjs or .jsx), then hints for this N00B as to how to approach coding a solution would be greatly appreciated.
- Or, should I abandon the idea of automating this task--and ~300 times--manually place the images on their page, embed the link, apply Caption Setup, activate Generate Live Caption, et cetera?
- Oh, did I mention? ~300 times! (Ugh!)
Suggestions and insights are invited and welcomed!
- With great gratitude from someone that is dreading 300 mind-numbing & repetitive and repetitive & mind-numbing PLACEments, et cetera.
Many thanks,
Plane Wryter
