Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Create a list of anything that uses a certain paragraph/character style

Return to Member Forum

  • Author
    Posts
    • #67103

      Hello everybody!

      I’ve been lurking the website and the forums for quite some time and it has been of great help to me in the process of refining my InDesign skills, but I didn’t make an account until now.

      I’m coming today with a problem that’s been in my head for quite some time (I know, the title isn’t that straightforward and explicative):

      I have a pretty specific script/automation requirement: I mostly typeset law books and there are hundreds and sometimes thousands of cases that need to be indexed. The standard format for them is [<case>, <chapters where they appear>]. This is pretty much done manually and it is extremely hard to redo the lists manually when some chapters change completely, or are deleted or change their numbers.

      Starting from the ToC creation idea, I was wondering if it is possible to make a ToC-like script that automates this process and allows you to create lists of specific texts that have a common style and the chapters/subchapters where they appear (those chapters also having their own unique styles).

      Hope I have been clear enough and thank you very much for your wonderful work done here!

      Kind regards,
      Alex

    • #67105
      Masood Ahmad
      Participant

      Hello Alexandro,

      If I have not misinterpret, you need a script to create an Index. I think Indiscripts have something for you, also listed other useful links:

      https://www.indiscripts.com/post/2011/11/indexmatic-frequently-asked-questions

      https://creativepro.com/building-an-index-using-character-styles-or-external-word-list.php

      https://www.kahrel.plus.com/indesign/lists_indexes.html

    • #67108

      Thank you very much for the reply, Masood!

      The links you gave me are really useful for creating Indexes and I thank you, they will really come in handy one day.

      The script that I’m looking for is a bit more simple (or is it?) than that: I don’t want the script to select just a list of words that have a certain style, I want it to take every group of consecutive characters that have that particular style, and specify their corresponding chapter/section number.

      To give you an example, on a page that has two chapters there are two cases in different blocks of text: VanDyke v. SKI Ltd., 67 CA4th 1310 (1998) in section §1:01 and Curties v. Hill Top Developers, Inc., 14 CA4th 16 51 (1993) in section §1:02. These cases have a Character Style named CASE TABLE and the sections have a Character Style named RUNNING HEADER.

      I am looking for a script that can look for these two styles and order them in a list (alphabetically or not) that would look something like this:

      VanDyke v. SKI Ltd., 67 CA4th 1310 (1998), §1:01
      Curties v. Hill Top Developers, Inc., 14 CA4th 16 51 (1993), §1:02

      So the script idea (I have no idea about scripting so I’m just getting this on a logical pattern) would be something like:
      [CASE TABLE], corresponding [RUNNING HEADER]

      • #67376

        Alexandro,

        If I’ve understood your requirements correctly, I may have written a script that meets your need. This script has been very MINIMALLY tested. The requirements for the script to work are:

        1. A specific paragraph style is assigned to each section heading
        2. The chapter/section identifier is normal text and comprises the first characters of each section heading.
        3. The chapter number is separated from the section number by a colon character.
        4. A specific character style is assigned to each case name
        5. No section heading appears inside of a table (It’s OK for case names to reside inside of tables)

        I’m posting the script to my site https://press.matthewmariani.us along with an idml file you can use to do some initial testing.

      • #67378

        Thank you very very much for taking the time to write this up. I have tested it using your .idml file and it works wonderful, with an effective panel where you can select the layers.

        Unfortunately, the format of my chapter numbers is [§1:01 First section in chapter 1] instead of [1:01 First section in chapter 1], and that little § seems to break the whole script since it doesn’t find anything in a random chapter I’ve selected. Could you leave an e-mail address? I want to send you one of my book chapters and see ‘live’ what’s going on.

        Also, after the basics are fixed, I’d like to know if adding several chapter styles to search at once is doable and other small tweaks.

        Again, thank you so much for your hard work.

      • #67403

        I’ve updated the script to expose the grep expression used to match the format of the chapter/section identifiers in the user interface of the script, so it can be customized. The default setting matches what you describe, I think. New version available at https://press.matthewmariani.us. My contact info can be found at https://www.matthewmariani.us

        Hope that helps.

    • #67220

      This can be done, but the script would need a way of determining which chapter/section each bit of text formatted with the CASE TABLE style appears in. Is the chapter/section indicated in the running header of every single document page? How is the chapter/section numbering implemented? Does the chapter/section number appear in a running header on a master spread? If so, is the master spread text frame containing the running header ever overridden to a publication page? The script would have to work based on the way the document is set up.

    • #67221

      Thank you for the reply Matthew!

      Knowing that this kind of script can be attempted is a big leap forward. As you mentioned, the script has to be written based on how the document is set up, so here are some specifics:

      The master page of the book that handles the chapters has two text variables (one on each page, in the header) that handle the running headers. The one on the left has on the ‘Use:’ setting section ‘First on Page’ and the one on the right has ‘Last on Page’. So the section numbers appear on every single document page.
      The text frame containing the running headers never get overridden.

      The thing is that I don’t think the script can take the section number in the header and put all the cases on that page with that header since on a page there are, for example, section 1.05, 1.06 and 1.07, but the Running Header shows 1.05 (when on the left side page) or 1.07 (when on the right side page).

      So, on a very unspecialized, basic level of design, the script should identify the CASE TABLE and start verifying backwards, each paragraph, until it hits the first RUNNING HEADER style and that would be the one that the case belongs to.

      Let me know if you need any more info.

      Thank you!

    • #67225

      So each section begins with a chapter/section designator, for example, 1.07 and this text has an applied character style of RUNNING HEADER? I mistakenly thought that the RUNNING HEADER style was applied to text in a running header. That would provide a hook to identify which section each case belongs to. Then the script would have to aggregate the chapter/section designators for multiple occurrences of the same case, right? I think that could be done if each citation of a given case is identical to every other citation of the same case.

    • #67226

      Regarding your first question, exactly. The body of the chapter/section has a different style applied to it. The RUNNING HEADER style is only for the chapter/section titles. The usual format is, for example, 1.01^tIntroduction
      If I understood you correctly, yes, the script should get all chapter/section numbers where a case is present, and put them in the format I presented above.

      Regarding your last idea, some cases can be encountered just once in the whole book. Other ones reoccur in the exact same form in multiple chapters, or they even occur in different forms. This shouldn’t matter much, as long as all are identified and attributed the right chapter/section they are in.

Viewing 6 reply threads
  • You must be logged in to reply to this topic.
Forum Ads