Copy link to clipboard
Copied
Hi,
How we are searching the text (Find Text) in an InDesign manually from the position. Eg., In middle of the document placing the cursor and searching the text in document similarly I need to search the text. How can i say that position is cursor selection and search using findtext preferences.
app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;; |
app.findTextPreferences.appliedCharacterStyle = "E1";
app.findTextPreferences.findWhat = "Search Content"
//app.selection = 1851876449;
var res = app.activeDocument.findText();
Need to select from 2nd superscript (ie, superscript)1.
thank you...
Its working...
Copy link to clipboard
Copied
You're looking for the equivalent of 'Find to end of story'. Here's a way to do that:
ip = app.selection[0];
target = ip.parentStory.insertionPoints.itemByRange (ip, ip.parentStory.insertionPoints[-1]);
found = target.findText();
In other words, from the selected insertion pont to the insertion point's parent story's last insertion point.
Peter
Copy link to clipboard
Copied
Nice, Peter!
(^/)
Copy link to clipboard
Copied
thank you...
Its working...
Copy link to clipboard
Copied
Hi,
would you please mark Peter's reply as the correct one.
Thanks,
Uwe
Copy link to clipboard
Copied
Hi,
Marked correct answer..