Skip to main content
Known Participant
June 10, 2022
Answered

Script to add a gray border around placed images?

  • June 10, 2022
  • 1 reply
  • 546 views

I've placed 160 images in an InDesign file. Each is centered within a same-sized frame. I'd like to create a script that fits the frame to the image and draws a .75 pt gray border around it. How can I do this? I've hunted for a similar script I could modify, but so far no luck, and I'm not familiar with the InDesign scripting language.

 

Thanks!

This topic has been closed for replies.
Correct answer Willi Adelberger

Instead of a script create an object style and apply it. Object styles can exactly do that.

1 reply

Willi Adelberger
Community Expert
Willi AdelbergerCommunity ExpertCorrect answer
Community Expert
June 10, 2022

Instead of a script create an object style and apply it. Object styles can exactly do that.

DavidOfMAAuthor
Known Participant
June 10, 2022

Thanks. I hadn't known about object style. I just created one with a border as I described and can quickly apply it to the frame. That gets me halfway there. Is there a way within the object style to also fit the fram to the image? In my ancient version of InDesign, CS6, that doesn't appear to be a fitting option.

Legend
June 13, 2022

Hello @DavidOfMA,

Use this script to complete your task...

app.activeDocument.rectangles.everyItem().fit(FitOptions.FRAME_TO_CONTENT);

 

Regards,

Mike