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

Need help creating an Indesign Javascript to find and replace colors

New Here ,
Jun 21, 2021 Jun 21, 2021

Copy link to clipboard

Copied

Hello!

 

After scouring the internet for a few hours, I have come to the conclusion I need help. 

 

I am attempting to find a script that will find an unnamed color in Indesign (C:82, M:100, Y:11, K:0) and replace it with an existing swatch named "GGS purple"

 

I then need the same script to find GGS purple and replace it with the existing Pantone 186 C.

 

I also am looking for a find and replace script for text and the findchangebylist is baffling me as well.

 

This isn't something we do every day, but we have hundreds of documents to process and the find/change function in Indesign is great, but scripts will cut down on time, which matters with this many documents. 

 

Thank you so much in advance!

TOPICS
Scripting

Views

3.8K

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

Advisor , Jun 21, 2021 Jun 21, 2021

Hello Amanda!

 

Below are two different scripts,  the first one is for changing the swatches per your requirements and the second one is for "looking for text and changing to" you'll just to modify the "What you want to find" and the "Change to" for your needs. You could combine the two scripts together if you wanted.

 

re: This isn't something we do every day, but we have hundreds of documents to process and the find/change function in Indesign is great, but scripts will cut down on time, which mat

...

Votes

Translate

Translate
New Here ,
Jun 22, 2021 Jun 22, 2021

Copy link to clipboard

Copied

Hey @Laubender

 

Each of these documents has only one page, but if there were more, we would want it to apply to all pages except the masters. So it works for our needs. What would the script be if I needed it specifically only for page 1?

 

Thanks,

Amanda

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 22, 2021 Jun 22, 2021

Copy link to clipboard

Copied

Amanda said: "… What would the script be if I needed it specifically only for page 1"

 

Well, scripting method changeColors() is only known to the document.

 

A possible algorithm could be to set the findChangeColorOptions.includeLockedLayersForFind to false and lock all objects on all document spreads that should not be found and changed. After changeColor() is done to the document unlock all the objects that were locked before.

 

Regards,
Uwe Laubender

( ACP )

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