Skip to main content
October 4, 2010
Answered

Special Characters string not working?

  • October 4, 2010
  • 1 reply
  • 946 views

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!

This topic has been closed for replies.
Correct answer Joe_Charles

Search for unicode value for the characters, and make a new string using String.fromCharCode function:

     prefixString+String.fromCharCode(0xC7,0xC9...)+sufixString;

Regards

1 reply

Harbs.
Legend
October 4, 2010

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

October 4, 2010

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?

Joe_CharlesCorrect answer
Inspiring
October 4, 2010

Search for unicode value for the characters, and make a new string using String.fromCharCode function:

     prefixString+String.fromCharCode(0xC7,0xC9...)+sufixString;

Regards