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

Find Text from the selected Position

Contributor ,
Aug 07, 2017 Aug 07, 2017

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();

Screen shot 2017-08-07 at 7.48.24 PM.png

     Need to select from 2nd superscript (ie, superscript)1.

TOPICS
Scripting

Views

579

Translate

Translate

Report

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

correct answers 1 Correct answer

Contributor , Aug 07, 2017 Aug 07, 2017

thank you...

Its working...

Votes

Translate

Translate
Community Expert ,
Aug 07, 2017 Aug 07, 2017

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

Votes

Translate

Translate

Report

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
LEGEND ,
Aug 07, 2017 Aug 07, 2017

Copy link to clipboard

Copied

Nice, Peter!

(^/)

Votes

Translate

Translate

Report

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
Contributor ,
Aug 07, 2017 Aug 07, 2017

Copy link to clipboard

Copied

thank you...

Its working...

Votes

Translate

Translate

Report

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 ,
Aug 08, 2017 Aug 08, 2017

Copy link to clipboard

Copied

Hi,

would you please mark Peter's reply as the correct one.


Thanks,
Uwe

Votes

Translate

Translate

Report

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
Contributor ,
Aug 08, 2017 Aug 08, 2017

Copy link to clipboard

Copied

LATEST

Hi,

     Marked correct answer..

Votes

Translate

Translate

Report

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