Skip to main content
Known Participant
May 7, 2024
Answered

Find format from selected text or object

  • May 7, 2024
  • 4 replies
  • 645 views

Have some text with local formatting (font and colors, no paragraph or charcter styles) is it possbile to load these formatting to "Find/Change>Find Format:" without manually adding font, color and other propertiles of selected text (or object for 'Object' tab of Find/Change).

 

Something like "find/select" same fill or stroke color in Illustrator.

This topic has been closed for replies.
Correct answer Peter Kahrel

You can set a keyboard shortcut to copy the selected text to the 'Find what' field, but there's no such useful key for formatting codes. But if the range of properties you'll be looking for is limited you can use a script to populate the Find format panel. Something along these lines:

app.findGrepPreferences.fontStyle = app.selection[0].fontStyle;
app.findGrepPreferences.position = app.selection[0].position;
app.findGrepPreferences.fillColor = app.selection[0].fillColor;

 Set a keyboard shortcut to the script and you're done.

4 replies

Community Expert
May 9, 2024

Hi @Prince Oceans ,

to add to @Peter Kahrel 's post, you'll find a list of properties for app.findGrepPreferences in the InDesign DOM documentation compiled by Gregor Fellenz:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#FindGrepPreference.html

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
May 9, 2024

You can set a keyboard shortcut to copy the selected text to the 'Find what' field, but there's no such useful key for formatting codes. But if the range of properties you'll be looking for is limited you can use a script to populate the Find format panel. Something along these lines:

app.findGrepPreferences.fontStyle = app.selection[0].fontStyle;
app.findGrepPreferences.position = app.selection[0].position;
app.findGrepPreferences.fillColor = app.selection[0].fillColor;

 Set a keyboard shortcut to the script and you're done.

Robert at ID-Tasker
Legend
May 7, 2024

@Prince Oceans

 

Will be much easier - and quicker - if you tell us what is your end goal... 

 

Known Participant
May 9, 2024

Hi Robert 🙂

I'm seeking a more efficient way to identify and apply consistent text formatting throughout my document. With numerous documents in my queue, manually searching and replacing local text formatting using Find/Change for each instance is time-consuming. I'd appreciate a faster solution to streamline this process and maintain a cohesive style across my documents.

Robert at ID-Tasker
Legend
May 9, 2024

@Prince Oceans

 

OK. 

If you work on a PC - you could use full / paid version of my ID-Tasker.

 

You can create a Task that will load all so called Text Style Ranges - pieces of text that have different formatting than surrounding text - then read properties / formatting you are interested in keeping - there are 400+ properties - then sort by those properties - sort order will determine names of the Char / Para Styles that will be created.

 

So, for example, if you sort by Font + PointSize - you'll get "Arial Bold 10", "Arial Bold 12", etc.

If you add Color - Font + PointSize + Color - "Arial Bold 10 Red", etc. 

 

Then you can create different sets of styles for different "types" of text - body, anchored TextFrames, Tables, Footnotes, Layers, different Languages, for each Story, etc. - whatever you want. 

 

And then you can run this Task on bunch of files - to process them automatically.

 

Community Expert
May 7, 2024

@Prince Oceans said: "… is it possbile to load these formatting to "Find/Change>Find Format:" without manually adding font, color and other propertiles of selected text".

 

Good question…

But as far as I can see the answer is "no".

You have to populate the Find Format options one by one.

 

Regards,
Uwe Laubender
( Adobe Community Expert )