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

GREP? - how to find/highlight word(s) with multiple font styles?

New Here ,
May 16, 2019 May 16, 2019

Hello,

a long text placed into Indesign CC (from Microsoft Word) has multiple instances of (different) words, where these words, throughout the document, have multiple font styles (bold/italic/regular) applied.

For example, a word "actionable" is within the text as actionable, actionable, actionable; a word "legal" occurs as legal, legal, legal et cetera.

What I need is to be able to identify, highlight such words so that I can decide which font style shall be applied to the respective word according to the context.

Any ideas?

700
Translate
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 16, 2019 May 16, 2019

GREP is not concerned with the formatting of text, only with the text itself. You can use the style option to r strict you search based on style, but in this case I don’t see how it can help, since you’re trying to find text with a range of formatting, not one single formatting attribute.

For example, to find actionable you would need to find both the bold “action“ and the normal “able”. Th has not way to do that is to find “actionable“ without formatting. But that would no accomplish what you want.

If there are few of these options, you could search for each part and replace it with a special character or punctuation you’re not using, like a euro or yen. Search for a bold “action and replace with ¥. Search for a normal “able” and replace with €. Later search for “¥€” and replace with the clipboard contents, which you have already loaded with the properly formatted “actionable”. Of course this will take time, especially as you initially reject all the “action” and “able” that aren’t the ones you’re looking for.

It it may well be I have misunderstood your problem. Perhaps post a screen capture showing a before and after so we can better understand.

Translate
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 16, 2019 May 16, 2019
LATEST

(What's up with Jive today? This is the second time writing up an answer only lead to a grey spinning beachball o'death!)

Alternatively: remove the correct formatted words from the equation document. Then look for the remaining occurrences.

A safe way to "remove" the words is to change the default setting of an otherwise unused text attribute. For instance, if all your text is black, use find-and-change to set all entirely-regular, entirely-italic, and entirely-bold words to red. Then search for the words again but specify [Black] in the Find Format field -- this should locate all words that were not changed yet. And when done, simply delete the swatch Red and replace it with [Black] to restore all.

(10 minutes later) Oh well, I guess changing and checking one word at a time is a bore. This quickly written JavaScript prompts you for a word to find and will set a condition on all words with mixed formatting:

wordToFind = prompt ('Word to look for', '');

app.findTextPreferences = null;
app.findTextPreferences.findWhat = wordToFind;
app.findChangeTextOptions.wholeWord = true;

highlight = app.activeDocument.conditions.item('hi-lite');
if (!highlight.isValid)
highlight = app.activeDocument.conditions.add({name:'hi-lite',indicatorMethod: ConditionIndicatorMethod.USE_HIGHLIGHT, indicatorColor: UIColors.YELLOW});

list = app.activeDocument.findText();
while (word = list.pop())
{
if (word.textStyleRanges.length > 1)
  word.appliedConditions = [highlight];
}

Be warned that it is very thorough and so it might spot an inconsistency where you don't see one with the naked eye! Bold and italics are only the "most visible" formatting changes, but this script will also locate mixed kerning, applied language, or underline gap colors -- and tons more.

Translate
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