0 Replies Latest reply on Sep 21, 2015 7:55 PM by Kenneth C. Benson

    Collect and assemble parts of styled heads to create paragraphs to reference using running header variable

    Kenneth C. Benson Level 4

      The book I'm working on uses an outline-style numbering structure that is displayed using dictionary-style running heads. In chapter 21, a first-level head looks like

       

      § 21.01<tab>Introduction

       

      A second-level head looks like

       

      [1]<tab>Guide to HR Laws

       

      A third-level head looks like

       

      [a]<tab>New Rules Concerning Hiring

       

      The running head on a page that displays a first-level head should show

       

      § 21.01

       

      The running head on a page that displays a second-level head should show

       

      § 21.01[1]

       

      The running head on a page that displays a third-level head should show

       

      § 21.01[1][a]

       

      I want to use a running header variable to pick up "§ 21.01[1][a]" from the third-level head, but the third-level head doesn't actually display the entire "§ 21.01[1][a]" string. It only displays "[a]" and the text of the head. Because the text doesn't have "§ 21.01[1][a]" anywhere in it in one piece, I type it in after the 3 head and format it using a style that displays paper color and has 0 lead. Then I have the running header variable reference the content styled using this hidden paragraph. I repeat this for every 1, 2 and 3 head in the book.

       

      This system works great, but there are hundreds of heads in the book and manually adding the hidden paragraph for each head is tedious.

       

      I need a script that

       

      1) Creates programmatic variables for "head1number" (a string like "§ 21.01"), "head2number" (a string like "[1]"), and "head3number" (a string like "[a]").

      2) Searches for a 1, 2, or 3 head (by paragraph style) and does different things, depending on which one it finds:

           a) If it finds a 1 head, it should copy the number, store it in the variable "head1number", and then paste head1number after the 1 head in its own paragraph styled with the hidden paragraph style.

           b) If it finds a 2 head, it should copy the number, store it in the variable "head2number", and then paste head1number followed by head2number after the 2 head in its own paragraph styled with the hidden paragraph style.

           c) If it finds a 3 head, it should copy the number, store it in the variable "head3number", and then paste head1number followed by head2number followed by head3number after the 3 head in its own paragraph styled with the hidden paragraph style.

      3) Repeats step 2 until it finds no more new 1, 2, or 3 heads.


      Could this be done? I know just a little programming and could test and refine the script if someone got me started. I'm still using ID CS6.


      Thanks for any and all help,

      Ken Benson