Script that changes all non-black colors to "Black"

Community Beginner ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

Hello,

 

I am working with several documents that are imported from MS Word (sometimes texts are colored) and I need to layout them in 1C Black so all other colors must be replaced with "Black".

 

I saw a thread [here] for removing specific colors and replacing them with a specific color but in my case, sometimes the colors are randomly named so I have to generalize it.

 

Here's the process I have in mind:

- If the script detects that a color name is not equal to "[Paper]" && "[Black]" && "[Registration]",

it will automatically remove that color and replace it with Black.

 

 I'm trying to write the code myself but it just won't work. Any help will be highly appreciated 🙂

TOPICS
Scripting

Views

95

Likes

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

Guru , Apr 21, 2021 Apr 21, 2021

Likes

Translate

Translate
Adobe Community Professional ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

Can you post the code that won't work?

Likes

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 Beginner ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

LATEST

Hi Brian, I just based my code on this post 

then tweaked it a little.

 

 

Likes

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
Guru ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

Likes

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 Beginner ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

A million thanks! I downloaded the script and it works totally how I need it to be. 

Likes

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