4 Replies Latest reply on Jul 21, 2008 10:20 PM by (Douglas_Urner)

    Inserting Special Characters From JS

      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!
        • 1. Re: Inserting Special Characters From JS
          Level 1
          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
          • 2. Re: Inserting Special Characters From JS
            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
            • 3. Re: Inserting Special Characters From JS
              Level 1
              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
              • 4. Re: Inserting Special Characters From JS
                Level 1
                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