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

Help Need!

Engaged ,
May 25, 2016 May 25, 2016

Copy link to clipboard

Copied

Hello Everyone,

I can't find the text 6954 (The text placed in a table) between these symbol :: :: Please advice or suggest me

Help much appreciated. Thanks in advance.

Code:

main();

function main(doc){

    var myDoc = app.activeDocument

    app.findGrepPreferences = app.changeGrepPreferences = null

    app.findGrepPreferences.findWhat = "\\6954$"

    var myFound = myDoc.findGrep();

    alert(myFound.length);

}

Screen Shot 2016-05-25 at 12.55.10 pm.png

TOPICS
Scripting

Views

528

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

Community Expert , May 25, 2016 May 25, 2016

Yajiv,

just to make sure what kind of special characters you are seeing here execute this line of code:

app.documents[0].xmlViewPreferences.showTagMarkers = true;

The view of the text should go from this:

ShowTextMarkers-FALSE.png

to about that one:

ShowTextMarkers-TRUE.png

So we have XML text markers to consider here.

They are encoded in Unicode as FEFF .
Unfortunately InDesign's GREP search is not able to find them with \x{FEFF} .

Text Search is finding them with:  <FEFF>

What can we do now? Forget the GREP Search,

hand that task over to TEXT Search:

<FE

...

Votes

Translate

Translate
Guide ,
May 25, 2016 May 25, 2016

Copy link to clipboard

Copied

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
Engaged ,
May 25, 2016 May 25, 2016

Copy link to clipboard

Copied

"$" in your GREP search stands for "end of the story". So if there are index markers (could be XML tags as well) after your search string then they will not be found.

Thanks Stefan

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
Engaged ,
May 25, 2016 May 25, 2016

Copy link to clipboard

Copied

Hi Stefan,

Thanks for your reply.

Could you please explain why the find can't search the text between the index mark or xml tag.

or Is there is any way to find the text?

-yajiv

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 ,
May 25, 2016 May 25, 2016

Copy link to clipboard

Copied

Hi Yajiv,

I am assuming here, that you are not allowed to remove the special characters.

What is the result for the line of code tpkt1982 is offering in answer #1?

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
Engaged ,
May 25, 2016 May 25, 2016

Copy link to clipboard

Copied

Hi Laubender,

Thanks for the prompt response.

As per TPK instruction, I removed the double slash ("//") and its working fine without index marks.

However I received client file with index mark. Now I need to find the text content between the index marks.

Please advice me how to proceed this..

yajiv

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 ,
May 25, 2016 May 25, 2016

Copy link to clipboard

Copied

Yajiv,

just to make sure what kind of special characters you are seeing here execute this line of code:

app.documents[0].xmlViewPreferences.showTagMarkers = true;

The view of the text should go from this:

ShowTextMarkers-FALSE.png

to about that one:

ShowTextMarkers-TRUE.png

So we have XML text markers to consider here.

They are encoded in Unicode as FEFF .
Unfortunately InDesign's GREP search is not able to find them with \x{FEFF} .

Text Search is finding them with:  <FEFF>

What can we do now? Forget the GREP Search,

hand that task over to TEXT Search:

<FEFF>6954

I don't know what you like to do with the result.

The result is an array of Texts objects.

Regards,
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
Engaged ,
May 25, 2016 May 25, 2016

Copy link to clipboard

Copied

LATEST

Hi Laubender,

Its working like a charm.... Thank so much for your kind support.

@tpk Thank you so much for your help.

-yajiv

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