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

How to find character unicode and name in indesign using javascript.

Participant ,
Jun 26, 2020 Jun 26, 2020

Copy link to clipboard

Copied

Need to find selected character unicode value and name in indesign

TOPICS
How to , Scripting

Views

1.2K

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 ,
Jun 26, 2020 Jun 26, 2020

Copy link to clipboard

Copied

You can use the method charCodeAt defined on the string class

See the documentation for details

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#String.html

 

-Manan

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
Participant ,
Jun 26, 2020 Jun 26, 2020

Copy link to clipboard

Copied

glyphs.png

 

For example, How to get selected text unicode and their name same shown on glphs like as above.

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 ,
Jun 26, 2020 Jun 26, 2020

Copy link to clipboard

Copied

There is no api that will give you the name that i know if, for the Unicode value i already provided you a method that should work, does it not?

 

-Manan

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
Participant ,
Jun 26, 2020 Jun 26, 2020

Copy link to clipboard

Copied

i dont know how to use this, please share any sample lines.
and my requirement is need to find arabic letter in the group of multi language paragraph? is possible? 

apart from appliedLanguage.

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 ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

Yes you can find ARABIC letters with this:

 

 

[\x{0591}-\x{05F4}\x{FB1D}-\x{FB4F}\x{0600}-\x{060A}\x{060C}-\x{06EF}\x{06F0}-\x{06F9}\x{06FA}-\x{06FF}\x{0750}-\x{077F}\x{08A0}-\x{08FF}\x{206C}-\x{206D}\x{FB50}-\x{FD3D}\x{FD50}-\x{FDFB}\x{FDFD}\x{FE70}-\x{FEFC}\x{1EE00}-\x{1EEF1}]

 


-Sumit

-Sumit

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 ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

Sumit's solution is the best way to go about looking for Arabic characters in a multilingual paragraph... assuming that Farsi doesn't appear in that paragraph, right? Or Pashto or Kurdish, depending on the glyph used. Somewhere I have JS that I wrote back in the CS4 era that searches multilingual paragraphs for such characters and then identifies language based on glyphs used in only one language - e.g. you usually won't find reh with dot below and dot abobe (Ú–) in Arabic. I can dig that code up for you if you are interested. 

 

But yes, specifying Unicode ranges in a regex, as Sumit suggests, is likely your best way to find Arabic glyphs in multilingual stories. To find the Unicode names of those glyphs feels like a multi-step process to me, and I would send you in the direction of this conversation at stackoverflow if you absolutely had to gin up some JS that would return the Unicode glyph names. 

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 ,
Jul 26, 2021 Jul 26, 2021

Copy link to clipboard

Copied

LATEST

I have added more on this regex "HEBREW" and "ARABIC".

-Sumit

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