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()?
You can use
app.selection[0].findTEXT()app.selectionis 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
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.