8 Replies Latest reply on Nov 25, 2008 10:13 PM by sstanleyau

    nested styles and delimiters

      Hello,

      Is there a way to script InDesign to insert the "literal" end nested style character everywhere another character (delimiter) has been used to end a nested style?

      I want to add the end nested style character, not replace whatever character is used to signal the shift in the layout.

      I'm working with exported INX files using XSLT. I can handle nested styles just fine if the end nested style character is used. (These export as a processing instruction.) However, using other delimiters poses substantial problems. I'm hoping I can work around this by adding the end nested style character before export.

      Thanks,
      Andrea
        • 1. Re: nested styles and delimiters
          On Tuesday 18 November 2008 21:58:35 andrea laue wrote:
          > Is there a way to script InDesign to insert the "literal" end nested style
          > character everywhere another character (delimiter) has been used to end a
          > nested style?
          >
          > I want to add the end nested style character, not replace whatever
          > character is used to signal the shift in the layout.
          i would solve this brutal force:
          check every paragraph if nestedStyles are set, check out the delimiter and add
          the literal nestedstyle character after
          • 2. Re: nested styles and delimiters
            Level 1
            sorry just hit the return button undeliberate.

            the suggested solution is probably pretty slow with large doucment and there
            is a little hacking to get the nested styles right.

            a cool hack would be very nicebut i don't see it in the object model.

            regards,
            gregor
            • 3. Re: nested styles and delimiters
              Level 1
              Hi Gregor,

              Thanks for the reply.

              I've written a script that detects nested styles, grabs the delimiters, and searches for instances of those delimiters within a given paragraph. I "grab" the delimiters using the delimiter property of the nested style, which returns either a string or a nested style character enumerator.

              The problem is with the latter scenario. I can search the text of the paragraph for a string, but not for the enumerator.

              I don't see a way to grab the special character associated with the enumerator -- or to translate the enumerator to the appropriate special character. (The latter could be done by building a lookup table within the script, but I'd like to avoid that.)

              Any suggestions?

              Thanks,
              Andrea
              • 4. Re: nested styles and delimiters
                sstanleyau Level 4
                The end nested style character is just ASCII character 3 -- you can search a<br />string for that.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>
                • 5. Re: nested styles and delimiters
                  Level 1
                  Hi Shane,

                  Thanks for the quick reply.

                  So my issue is with the delimiters that are NOT the special ENS character. (Perhaps I should have restated that from my previous post in the thread.)

                  In fact, I need to detect the non-ENS character delimiters so as to insert (and export) an ENS character.

                  Thanks,
                  Andrea
                  • 6. Re: nested styles and delimiters
                    sstanleyau Level 4
                    On 26/11/08 10:16 AM, "andrea laue" <member@adobeforums.com> wrote:<br /><br />> I need to detect the non-ENS character delimiters<br /><br />You first need to find what they are for each nested style, which means<br />getting the delimiter, inclusive, and repetition values for each.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>
                    • 7. Re: nested styles and delimiters
                      Level 1
                      Right. I can get the delimiters, but they're returned as end nested style enumerators, i.e. "1397124194" for the forced line break character.

                      But searching for "1397124194" won't retrieve instances of the forced line break in the paragraph styled with nested styles.

                      How can I map the enumerators to the characters in the text? (I'd prefer to avoid making a literal map; I'm hoping the API supports this somehow.)

                      Thanks,
                      Andrea
                      • 8. Re: nested styles and delimiters
                        sstanleyau Level 4
                        I guess you're going to have to build a table matching the enumerations to<br />the actual characters, although I'm not sure that's possible with all the<br />enumerations.<br /><br />-- <br />Shane Stanley <sstanley@myriad-com.com.au><br />AppleScript Pro Florida, April 2009 <a href=http://scriptingmatters.com/aspro>