GREP - Find U+XXXX —> Replace x\$1 ?

Explorer ,
Sep 07, 2022 Sep 07, 2022

Copy link to clipboard

Copied

Hi,

I would like to search for text, example : U+E302.

And replace with an icon font, using this found unicode.

 

I know a script would do a perfect job. But I can't use it. Is Grep able to do it? I want to use it in paragraph styles.

 

For the search field, no problem. I can use something like this : U\+(.{4}).

Replace with \x{$1} will rewrite this : \x{myFound}, as plain text! And not THE character \x{myFound}.

 

Hope this image explain better :

Capture d’écran 2022-09-12 à 16.59.38.jpeg

 

 

Have you ever use this?

Thank you

TOPICS
Performance

Views

92

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 2 Correct answers

Explorer , Sep 12, 2022 Sep 12, 2022

Thank you.

I just share a way that could work : combining Grep for styling and Autocorrect functionalities.

https://www.youtube.com/watch?v=ZnSYZITvNhI

 

Quite uncomfortable, but it can work in live — that's what important for me. I will test.

Likes

Translate

Translate
Community Expert , Sep 12, 2022 Sep 12, 2022

@Eugene Tyson said: "But that won't happen - as far as I know - and said at the start - you can't type unicode characters directly into InDesign. You need to use the Glpyhs panel."

 

Hi Eugene,

 

to type in a Unicode code point is possible with a script!

One possible script is provided with every InDesign version that has the Community folder in the Scripts panel. Look up the UnicodeInjector.jsx script there. However, the script is a bit odd. You have to duplicate the script file and you have to

...

Likes

Translate

Translate
Community Expert ,
Sep 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

I don't think even typing unicode to InDesign works - as far as I know - you need to select the Glyph from the Glyphs panel.

 

I did find this 

https://creativepro.com/files/kahrel/indesign/grep_mapper.html

 

I'm not sure how it can help.

 

I think GREP can do it - but I think it needs a script to run it correctly throughout the document.

And I wouldn't have a clue how to do this.

 

 

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 ,
Sep 12, 2022 Sep 12, 2022

Copy link to clipboard

Copied

Eugene,

Yes I already use grep_mapper! Nice script. But it will not help.

As my message shouldn't be really clear, I have rephrased it.

Thank you.

 

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 Expert ,
Sep 12, 2022 Sep 12, 2022

Copy link to clipboard

Copied

Hi @jjrger ,

maybe I do not understand the issue.

If you want to find the glyph with Unicode code point \x{E303} and if you want to replace it with \x{E303} plus a different font, just adjust the Find Change* specification in the GREP Find Change* part.

 

If that does not work for whatever reason:

How about using GREP's Change feature to fetch the formatted contents of the clipboard?

If all the found text is formatted the same, same font style, same font size etc., that should work.

 

Select the icon font character and copy it to the clipboard.

 

GREP Find:

 

 

\x{E302}

 

 

GREP Change to the formatted contents of the clipboard:

 

 

~c

 

 

 

Regards,
Uwe Laubender
( Adobe Community Professional )

 

* Sorry. Sent my reply too soon.

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 ,
Sep 12, 2022 Sep 12, 2022

Copy link to clipboard

Copied

Thank you.

Yes my question is not really clear. I've just rephrased it. With an image to illustrate!

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 Expert ,
Sep 12, 2022 Sep 12, 2022

Copy link to clipboard

Copied

Yes - I get it. 

You want to replace anywhere there's unicode text like U+XXXX and

replace the text with \xXXXX 

Where you want the unicode character to pop in.

 

But that won't happen - as far as I know - and said at the start - you can't type unicode characters directly into InDesign.

You need to use the Glpyhs panel.

 

This is why I think you need to consult a script or someone who does scripts.

As they would be able to script finding the text - finding it in the Glyphs panel and replacing it in insitu.

 

I definitely can't think of a way with GREP on it's own - but there are some serious GREP masters on here who know more than I do.

 

 

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 ,
Sep 12, 2022 Sep 12, 2022

Copy link to clipboard

Copied

Thank you.

I just share a way that could work : combining Grep for styling and Autocorrect functionalities.

https://www.youtube.com/watch?v=ZnSYZITvNhI

 

Quite uncomfortable, but it can work in live — that's what important for me. I will test.

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 Expert ,
Sep 12, 2022 Sep 12, 2022

Copy link to clipboard

Copied

LATEST

@Eugene Tyson said: "But that won't happen - as far as I know - and said at the start - you can't type unicode characters directly into InDesign. You need to use the Glpyhs panel."

 

Hi Eugene,

 

to type in a Unicode code point is possible with a script!

One possible script is provided with every InDesign version that has the Community folder in the Scripts panel. Look up the UnicodeInjector.jsx script there. However, the script is a bit odd. You have to duplicate the script file and you have to rename it to show the script code what you like to insert!

 

Sample file name for inserting Unicode code point 0061 that stands for LATIN SMALL LETTER A:

U+0061 InsertThat.jsx

 

FWIW: If you have no write access to the Scripts folder of InDesign's Application folder, copy the script to the User Scripts folder in your personal User path of your machine. For my German InDesign 2022 version 17.4.0 on Windows 10 the file path is:

User > [Your User Name] > AppData > Roaming > Adobe > InDesign > Version 17.0 > de_DE > Scripts > Scripts Panel

 

The easiest way to open the path to the Scripts Panel  folder on your machine is to select the User folder in InDesign's Scripts panel in the GUI and select the menu command to Show in Finder (Mac) or Show in Explorer (Windows). Copy the script file to the Scripts Panel folder and you will see the script instantly be listed in the User folder of the Scripts panel in InDesign.

 

Well, that all said, a far better method is using a script by Marc Autret named InstantUnicode:

 

InstantUnicode | Insert Characters by Typing their Codepoint
Marc Autret, March 12, 2020

https://www.indiscripts.com/post/2020/03/instantunicode-insert-characters-by-typing-their-codepoint

 

 

Regards,
Uwe Laubender
( Adobe Community Professional )

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