Copy link to clipboard
Copied
Hi All
How to get unicode value of a selected char?
The contents property of an InDesign object "Character" is a plain Unicode string. Accessing the individual characters is a basic javascript operation, and a google gives this as a good first result: http://www.w3schools.com/jsref/jsref_charCodeAt.asp
Therefore, the unicode value of a selected char is
app.selection[0].characters[0].contents.charCodeAt(0)
Copy link to clipboard
Copied
The contents property of an InDesign object "Character" is a plain Unicode string. Accessing the individual characters is a basic javascript operation, and a google gives this as a good first result: http://www.w3schools.com/jsref/jsref_charCodeAt.asp
Therefore, the unicode value of a selected char is
app.selection[0].characters[0].contents.charCodeAt(0)
Copy link to clipboard
Copied
AYS. HAKKIM wrote:
How to get unicode value of a selected char?
You will get answer quicker - if you specify in which language you need help - JS, AS or VB?
robin
www.adobescripts.com
Copy link to clipboard
Copied
Hi Hakkim,
It is very easy.Select the character & execute the below code:
For special characters: app.selection[0].contents;
For normal characters: app.selection[0].contents.charCodeAt(0);
Regards,
Ramkumar .P
Copy link to clipboard
Copied
Many thanks to all