Copy link to clipboard
Copied
Hello,
Using Javascript/CS5, I'm trying to put a string of special characters into a text frame using the "SpecialCharacters.TRADEMARK_SYMBOL" syntax. It works, but only if I use one special charaters. Doing this:
myTextFrame.insertionPoints[-1].contents = SpecialCharacters.BULLET_CHARACTER + ' ' + SpecialCharacters.TRADEMARK_SYMBOL;
Gives me this result in the text frame, it uses the numeric value now: 1396862068 1398041963
I'm wondering how I could put several special characters together in a text frame but actually get the symbols to show up?
Thanks!
Search for unicode value for the characters, and make a new string using String.fromCharCode function:
prefixString+String.fromCharCode(0xC7,0xC9...)+sufixString;
Regards
Copy link to clipboard
Copied
You can't string together special characters because it converts them to strings instead of SpecialCharacters.
You can either use the unicode values (if that's an option), or insert them separately.
Harbs
Copy link to clipboard
Copied
cool, I will just add them separately. But what about symbols for 1/2 and 1/4? I don't see a SpecialCharacters option for those?
Copy link to clipboard
Copied
Search for unicode value for the characters, and make a new string using String.fromCharCode function:
prefixString+String.fromCharCode(0xC7,0xC9...)+sufixString;
Regards
Copy link to clipboard
Copied
awesome, thanks for the help guys. That works perfectly!
Copy link to clipboard
Copied
If you know the unicode value, there's no need to use functions. Simple unicode notation works fine:
(i.e. "\u00BD" + " is a one-half symbol")
Harbs
Find more inspiration, events, and resources on the new Adobe Community
Explore Now