Is built-in Find/Change by list script Unicode compliant?

Community Beginner ,
Mar 06, 2019 Mar 06, 2019

Copy link to clipboard

Copied

I'm using the built-in find/change by list script for a scholarly text. It works fine, but some search and replace queries that involve some more unusual characters are turned into gibberish.

So I'm wondering if anybody knows whether the script is actually fully Unicode compliant, or if there is something that I'm doing wrong.

The query I've been using is below (the academic author uses a hacked pi font to get special ornaments instead of the correctly encoded unicode characters, hence the substitution):

grep    {findWhat:"(?<=\\s)r(?=\\s)"}    {changeTo:"ﷺ"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find r between any whitespaces and replace with ﷺ.

grep    {findWhat:"(?<=\\s)u(?=\\s)"}    {changeTo:"ﷷ"}    {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}    Find u between any whitespaces and replace with ﷷ.

But when I run it, the outcome in InDesign is Ô∑∑ instead of ﷷ and Ô∑∫ instead of ﷺ . Any clues?

TOPICS
Scripting

Views

962

Likes

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 Beginner , Mar 07, 2019 Mar 07, 2019
Manan, Peter,thank you for taking the time to look at this.Peter, to your questions: it worked manually and when I did a manual search, copy-pasting the very same characters into the search dialogue I tried the Unicode values using the <XXXX> as I would in the search dialogue, which of course didn't work. I wasn't aware of the syntax that you've given me, thank you! Where else could I find this?Manan, seeing that it worked for you, I tried it to with a new, clean document. This did not work. But...

Likes

Translate

Translate
Adobe Community Professional ,
Mar 06, 2019 Mar 06, 2019

Copy link to clipboard

Copied

Works fine for me, the only guess i can make is that the encoding of the FindChangeList.txt is not correct at your end. Try to set it to UTF8 and then try. Have a look at the results i am getting and verify if the character is rendered correctly, maybe i am making wrong assumptions due to my  untrained eyes.

P.S. :- I am using the default paragraph composer of InDesignFind:Change.gif

-Manan

Likes

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
Adobe Community Professional ,
Mar 06, 2019 Mar 06, 2019

Copy link to clipboard

Copied

InDesign is Unicode-compliant, the script should be, too. What you see is strange behaviour.

Do you get the correct result when you insert the character and apply the font manually?

What happens when you do the find/change manually?

If the above don't work, maybe use the character's Unicode value instead of the character literal. To get a character'sUnicode value, enter it in a text frame, select it, and open the Info panel. It's displayed as e.g. 0xFDFA. In the GREP replacement, use the format \x{FDFA}

Likes

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 Beginner ,
Mar 07, 2019 Mar 07, 2019

Copy link to clipboard

Copied

Manan, Peter,

thank you for taking the time to look at this.

Peter, to your questions:

  • it worked manually and when I did a manual search, copy-pasting the very same characters into the search dialogue
  • I tried the Unicode values using the <XXXX> as I would in the search dialogue, which of course didn't work. I wasn't aware of the syntax that you've given me, thank you! Where else could I find this?

Manan, seeing that it worked for you, I tried it to with a new, clean document. This did not work. But then I moved the two queries that I've shared here to the top of the query list, and all of a sudden it worked. I've double checked by putting it below again, and then I had the same garbled text again.

This made me check the preceding GREP queries again, and I realised that I had not double escaped a number of queries, which in combination must have caused the replacements to go weird. I've checked and corrected everything and now it all works, no matter the order of queries.

Thank you both again!

Likes

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
Explorer ,
Jun 19, 2022 Jun 19, 2022

Copy link to clipboard

Copied

LATEST

I have got the same problem as you have. I can do the replace action by writing their Unicodes, but not the words themselves. You wrote that you paste those two queries and they started working suddenly. Could you please tell me how did you do that? I have tried several times, but nothing changed. It would be great if you could share with me your file that is working properly.

Likes

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