3 Replies Latest reply on May 18, 2010 11:16 AM by BRUNNEBA

    Need nested paragraph script

    nick-i

      I'm not new to InDesign, but I am to the javascript. I am hoping someone can help me with this.

       

      I am working on some technical documents which require some nested and numbered lists/paragraphs. An example is below:

       

      1.     a. yada yada yada

              b. yayayayayayayaydadadadaad

       

      2.     a. insert text here.

              b. insert more text here.

       

      Looks simple, right?

       

      It's not.

       

      The problem is I can't get the alpha list to go in-line with the numbered parent list. It always starts as another paragraph on the next line, leaving the parent numbered line completely blank.

       

      I tried the 'nested paragraph styles' under drop caps and nested styles options, but that only seems to work on character formatting and not full paragraph alignment.

       

      I have FrameMaker 9, in which the run-in paragraph style works well, but I am needing to convert all documents to InDesign for various reasons. And a lot of them have this type of nested paragraphs. Can anyone help me in the right direction? if there isn't a script already made, can someone show me how to create it?

       

      Many thanks for any help provided.

        • 1. Re: Need nested paragraph script
          Dave Saunders Level 4

          Looks simple, I agree, but it's not.

           

          A script will be needed (I think -- I have been known to underestimate the lists feature, but I don't think two different lists can increment in the same paragraph). I don't think one has been floated here before.

           

          Dave

          • 2. Re: Need nested paragraph script
            AdobeScripts Level 3

            1.     a. yada yada yada

                    b. yayayayayayayaydadadadaad

             

            2.     a. insert text here.

                    b. insert more text here.

             

            there is solution:

            you need to prepare 3 ParagraphStyles:

            1) for numbers - level 1

            2) for "a" with leading = 0 - it will go up and cover "numbers" - level 2

            3) for "b", "c" ... letters - level 2

             

            paragraphs with "numbers" - need to be empty

            • 3. Re: Need nested paragraph script
              BRUNNEBA Level 1

              Did anyone ever find a solution to this?  I'm trying to do the EXACT same thing, except my bullets are the same character.  I need to be able to apply different paragraph styles to the Level 1  and to the level 2, and I need to do this in a script.   Any suggestions?

               

              I currently have a script that dumps the text into the text frame, but I need to know how to apply nested paragraph styles in a script... hopefully something I can add to my existing script (pasted below)

               

               

               

              filename = "/c/testfile.txt";
              myFileObj = new File(filename);
              if (myFileObj.open("r"))
              {
                   theText = myFileObj.read();
                   myFileObj.close();
                   app.selection[0].contents = theText;
              } else
              {
                   alert ("Unable to open file "+filename);
              }