4 Replies Latest reply on Jun 14, 2012 3:30 PM by [Jongware]

    Truncate running header paragraph style

    darcyjdbrennan

      I would like the running header to show

       

      Aard - Adv

       

      instead of Aardvark - Advent

       

      I haven't found a way to do this yet, can someone point me in the right direction? Currently it uses a running  first instance of a paragraph style that is picking up "Aardvark" and "Advent" from a phone book style document and working fine in this regard.

       

      Thanks!

        • 1. Re: Truncate running header paragraph style
          Peter Spier Most Valuable Participant (Moderator)

          Apply a character style tot he first three letters of the paragraph (use a nested style, and the definition can be nothing but a name, no attributes at all), thenuse a Running Header (Character Style) variable. That will only get you Aar - Adv, though.

           

          The only way to get a variable number of characters would be to apply the character style to a varialbe number of characters at the start of the paragraph, and that is going to require manual intervention, either to apply the style, or to set an "end nested style here" character and use that for the trigger instead of an number of characters. Of course you might want to do that anyway, if you 1- or 2- character words to index.

          1 person found this helpful
          • 2. Re: Truncate running header paragraph style
            darcyjdbrennan Level 1

            Hello Peter. Thanks for this solution. I have considered using a character style variable, however, I will be using the running header text variable on a master page, and using a data merge to fill in ~100's of pages with data, making the application of a character style very time consuming, and prone to requiring a change if there are edits needed on the data.

             

            One other solution I have considered, but which I am not sure how to proceed with, is to move the content of a text variable into a string, truncate it, and return it to another custom text variable that could be used in place of the running header text variable, but I have not found the proper method in javascript.

            • 3. Re: Truncate running header paragraph style
              TᴀW Adobe Community Professional & MVP

              Check out In-Tools Power Headers. I believe you can add a GREP

              expression to your headers, and that would be your answer.

               

              Ariel

              • 4. Re: Truncate running header paragraph style
                [Jongware] Most Valuable Participant

                darcyjdbrennan wrote:

                [..] One other solution I have considered, but which I am not sure how to proceed with, is to move the content of a text variable into a string, truncate it, and return it to another custom text variable that could be used in place of the running header text variable, but I have not found the proper method in javascript.

                 

                That's not going to work. It would require defining two custom variable per page, and in that case you'd better make the script fill in the right word fragments straight away.

                 

                Peter's suggestion of adding End Nested Style sounds like a good one -- at least that can be scripted, and you can still use variables for your headers. But I'm wondering about

                 

                Aard - Adv

                 

                -- what is the idea behind four letters for the first, three letters for the second entry? Should that *always* be the case, or would your hypothetical script cut off words right after a sequence of two consonants?