• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Script to add a gray border around placed images?

Explorer ,
Jun 10, 2022 Jun 10, 2022

Copy link to clipboard

Copied

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!

TOPICS
How to , Scripting

Views

236

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 10, 2022 Jun 10, 2022

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

Votes

Translate

Translate
Community Expert ,
Jun 10, 2022 Jun 10, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 10, 2022 Jun 10, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 12, 2022 Jun 12, 2022

Copy link to clipboard

Copied

Hello @DavidOfMA,

Use this script to complete your task...

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

 

Regards,

Mike

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 12, 2022 Jun 12, 2022

Copy link to clipboard

Copied

Thanks. I have other frames in this file that I don't want to fit frame to content, so I ended up doing it manually. Still helpful to learn about object styles, though.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 13, 2022 Jun 13, 2022

Copy link to clipboard

Copied

LATEST

FYI, CS6 does have these options in object styles:

PeterKahrel_0-1655110105607.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines