How to find character unicode and name in indesign using javascript.
Copy link to clipboard
Copied
Need to find selected character unicode value and name in indesign
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
Copy link to clipboard
Copied
For example, How to get selected text unicode and their name same shown on glphs like as above.
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
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.
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
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.
Copy link to clipboard
Copied
I have added more on this regex "HEBREW" and "ARABIC".

