Highlighted

Is there a simple way to find/change multiple words and highlight?

Community Beginner ,
May 08, 2020

Copy link to clipboard

Copied

I would like to create a GREP search or Script that would search a list of pre-defined words that are on my company's "do not use" list. My ideal would be that InDesign would search for these words (regardless of capitalization, or use ... I'll explain this in a moment), and highlight each occurrence.

 

To clarify, this is what I am trying to accomplish:

 

Find "Ensure" | highlight the word | find next use of the same word and repeat until no more are found;

Then, find the next word in the list and do the same

Repeat until the list is completed throughout the document.

 

However, we might use "Ensuring" or "Ensured" ... I would want these highlighted as well. I'm okay if we just search "ensur" ... but it would need to be found regardless of capitalization and any use of the root word "ensur". 

 

I'd started this as individual GREP Find/Change, but we have over 50 words that I would need this done for and we work in LONG documents, so doing this 50+ times is not the best use of our time. I was hoping for just one GREP search, or even a script that would do this in one click.

 

Does this make sense? 

Thanks!!

TOPICS
How to, Scripting

Views

1.0K

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

Is there a simple way to find/change multiple words and highlight?

Community Beginner ,
May 08, 2020

Copy link to clipboard

Copied

I would like to create a GREP search or Script that would search a list of pre-defined words that are on my company's "do not use" list. My ideal would be that InDesign would search for these words (regardless of capitalization, or use ... I'll explain this in a moment), and highlight each occurrence.

 

To clarify, this is what I am trying to accomplish:

 

Find "Ensure" | highlight the word | find next use of the same word and repeat until no more are found;

Then, find the next word in the list and do the same

Repeat until the list is completed throughout the document.

 

However, we might use "Ensuring" or "Ensured" ... I would want these highlighted as well. I'm okay if we just search "ensur" ... but it would need to be found regardless of capitalization and any use of the root word "ensur". 

 

I'd started this as individual GREP Find/Change, but we have over 50 words that I would need this done for and we work in LONG documents, so doing this 50+ times is not the best use of our time. I was hoping for just one GREP search, or even a script that would do this in one click.

 

Does this make sense? 

Thanks!!

TOPICS
How to, Scripting

Views

1.0K

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
May 08, 2020 0
Advocate ,
May 08, 2020

Copy link to clipboard

Copied

You want that to be interactive... what action will be done after each highlighting? Do you want it for each occurences of a specific word, than all the next one, and so on? Or it could be all mixed order?

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
Reply
Loading...
May 08, 2020 0
Community Beginner ,
May 11, 2020

Copy link to clipboard

Copied

Basically the highlight will be for our reviewers to verify that the content that is highlighted is what they want to say, and if not they will edit. We use a character style to make the highlight.

 

Order - it doesn't matter ... as long as all the words in our list are found!

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
Reply
Loading...
May 11, 2020 0
Advocate ,
May 11, 2020

Copy link to clipboard

Copied

You can try to use something like this:

(?i)\b(ensur|word2|word3).*?\b

(?i) if for making InDesign GREP case insensitive
\b is for words boundaries making InDesign search a whole word
Inside the ( ) are your words separated by a pipe | 
After the closing ) you find .*? to capture, if presents any additionnal character after the words in your list. In the sample here, teh word ensur, ensure and ensuring will be found.
You can use this to apply either your highlight character style, or a Text Condition set to Highlight for the indicator method. I would definately use a Text Condition for that since applying a character can interfere with already styled text. 



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
Reply
Loading...
May 11, 2020 2
cdimauro LATEST
Community Beginner ,
May 18, 2020

Copy link to clipboard

Copied

Thank you, I'm going to try this now!

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
Reply
Loading...
May 18, 2020 0
Advocate ,
May 08, 2020

Copy link to clipboard

Copied

A long GREP query could apply a Condition Text highlight to your 50 words. Than a simple Find can be use to go to each of them.

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
Reply
Loading...
May 08, 2020 1
Contributor ,
May 09, 2020

Copy link to clipboard

Copied

I have a script for find/change of multiple pairs, and it has confirmation along the way as found instances are selected. So perhaps it would be helpful to you. Its intent was to search and replace, but you could click the skip button each time something is found. This might give the result you want. ??? I could modify the script if it's close but not quite the solution. As for "ensure" vs "ensuring" just put both into the CSV file (and more). I've considered a version of this script using GREP but haven't gotten around to it, and no one has asked for it. Most scripts I make are usually something to solve a problem with with current job, or someone else has expressed a specific need. Anyway have look. Free to download.

https://www.marspremedia.com/software/indesign/find-change-from-spreadsheet

William Campbell
Mars Premedia

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
Reply
Loading...
May 09, 2020 4
Adobe Community Professional ,
May 10, 2020

Copy link to clipboard

Copied

You could also give FindChangeByList script shipped with InDesign. In a nutshell this script takes input from a text file where you can write your find/change queries and processes those queries one at a time. So you would add a query for each word in your "do not use", highlight it using say a CharacterStyle with a that applies color. So once the script execution is complete each word in the list would be higlighted with it's unique color

 

-Manan

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
Reply
Loading...
May 10, 2020 2
Adobe Community Professional ,
May 11, 2020

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
Reply
Loading...
May 11, 2020 1