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

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

Community Beginner ,
May 08, 2020 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

3.0K

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

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 Beginner ,
May 11, 2020 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!

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



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 Beginner ,
May 18, 2020 May 18, 2020

Copy link to clipboard

Copied

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

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

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
Enthusiast ,
May 09, 2020 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

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
Enthusiast ,
Oct 27, 2022 Oct 27, 2022

Copy link to clipboard

Copied

By the way, in the time since I posted this, I now have a GREP version of the script.

https://www.marspremedia.com/software/indesign/grep-replace-from-spreadsheet

 

William Campbell

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 ,
May 10, 2020 May 10, 2020

Copy link to clipboard

Copied

You could also give a try to 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

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
Mentor ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

https://forum.rudtp.ru/threads/skripty-na-temu-findchangequery-poisk-i-obsuzhdenie.75422/ - more links to such scripts.

Remember, never say you can't do something in InDesign, it's always just a question of finding the right workaround to get the job done. © David Blatner

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 ,
Oct 27, 2022 Oct 27, 2022

Copy link to clipboard

Copied

LATEST

Looks like you're in the wrong forum. InDesign can't help you improve your website.

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