0

I'm searching for a way to find the text of a specific paragraph style in an InDesign document but without searching the whole document, instead, I want to search only inside a text frame or other object.

The only way I found for now is using document.findText() and setting the findTextPreferences, is there something like myTextFrame.findText()?

Syntle
  • 5,168
  • 3
  • 13
  • 34

1 Answers1

0

You can use app.selection[0].findTEXT()

app.selection is an array that contains what you are selecting in Indesign.

And the [0] is the first item of the array.

So, you can select the textFrame and do your search.

Or

myTextFrame = app.selection[0];
myTextFrame.findText();

also works.

This only works on single text frame. If you want to search in more than 1 textFrame, you may need to write a for loop to do it.

jeremyf
  • 18
  • 2