Skip to main content
Participating Frequently
July 20, 2008
Question

Inserting Special Characters From JS

  • July 20, 2008
  • 4 replies
  • 615 views
I'm writing a script to add credit and caption information to photographs and would like to support nested styles in the credit so that the provider and source could be formatted differently. What I am currently doing is this:

Credit = Provider + " / " + Source;

I'd like to include the special character "End Nested Style Here" after the Provider and Source but haven't been able to find the code that would be used to represent that character in Javascript. Does anybody know where to look to find this information?

Many thanks!
This topic has been closed for replies.

4 replies

Participating Frequently
July 22, 2008
On 20 Jul, 2008, at 10:58, Dave Saunders wrote:

> You'd think you could use this,
>
> Credit2 = Provider + SpecialCharacters.endNestedStyle + " / " +
> Source + SpecialCharacters.endNestedStyle
>
> But it doesn't work. You get the numeric value of the enumerator
> instead of the character. What you have to do is use its unicode
> value, which you can find by typing one into a story and then
> looking in the Info panel. This works:
>
> Credit1 = Provider + "\u0003 / " + Source + "\u0003";

Cool! I hadn't thought to look at the info panel for the character
code. Many thanks, that will make many things easier.

Doug
Participating Frequently
July 22, 2008
On 20 Jul, 2008, at 16:44, Carl Davaz wrote:

> Why don't you just create a nested paragraph style that uses the
> "/" as the delimeter in the style transition, then you don't have
> to invoke the "end nested style here" character. You'd just call
> the paragraph style for the credit.
>
> At our newspaper we use such styles:
>
> PHOTOGRAPHER NAME/Source
> Caption

Thank you! I didn't realize that the delimiter could be set to
anything I wanted -- I was thinking that it was limited to the
choices on the drop down list. This will definitely work for what
I'm doing.

Doug
Participant
July 20, 2008
Douglas,

Why don't you just create a nested paragraph style that uses the "/" as the delimeter in the style transition, then you don't have to invoke the "end nested style here" character. You'd just call the paragraph style for the credit.

At our newspaper we use such styles:

PHOTOGRAPHER NAME/Source
Caption

Thanks,

Carl
Inspiring
July 20, 2008
You'd think you could use this,

Credit2 = Provider + SpecialCharacters.endNestedStyle + " / " + Source + SpecialCharacters.endNestedStyle

But it doesn't work. You get the numeric value of the enumerator instead of the character. What you have to do is use its unicode value, which you can find by typing one into a story and then looking in the Info panel. This works:

Credit1 = Provider + "\u0003 / " + Source + "\u0003";

Dave