5 Replies Latest reply on Sep 22, 2012 10:18 PM by Trevorׅ

    Change case of first character in lists in InDesign CS6

    xsurfergirlx

      Hi,

       

      I have some long documents that contain lists that look like this:

      • lorem ipsum dolor sit amet, Consectetur Adipiscing elit
      • sed convallis turpis elementum lorem hendrerit lacinia
      • sed a nibh non tortor commodo lobortis sed in felis.

       

      I now need to make the first character of each list uppercase, ie:

      • Lorem ipsum dolor sit amet, Consectetur Adipiscing elit
      • Sed convallis turpis elementum lorem hendrerit lacinia
      • Sed a nibh non tortor commodo lobortis sed in felis.

       

      The problem is there are capitalisations within the lists that need to be retained, and I can't create a list of exceptions (words to ignore).

      Is there a way to change only the first character in the list to uppercase?

      The lists are styled.

       

      Any help would be appreciated, thanks :-)

        • 1. Re: Change case of first character in lists in InDesign CS6
          [Jongware] Most Valuable Participant

          Is a GREP style enough?

           

          1. Make a new character style "Caps", and set its Capitalization to All Caps

          2. Add this GREP style to your bullets paragraph style: ^. and have it apply the Caps char style

           

          Pro: every first character of your bullet style paragraphs will be capitalized, even if you move text around or edit it etc. -- it's magic!

           

          Con: they are not really "capitals", they are lower case characters with a Caps text attribute. That's particularly important if you export to an e-pub, for example (I don't think all e-pub readers recognize the text-transform to capitals. I'm not even sure InDesign exports it as such.)

          1 person found this helpful
          • 2. Re: Change case of first character in lists in InDesign CS6
            xsurfergirlx Level 1

            Thank you for your help! 

            I would still eventually like to make it an actual cap and not a pseudo-cap as it removes the margin for error, but as we are only exporting pdfs at the moment it works brilliantly!!

            I haven't had much exposure to GREP, but rest assured I will be  researching it now

             

            Thanks again

            • 3. Re: Change case of first character in lists in InDesign CS6
              Trevorׅ Adobe Community Professional

              Hi

               

              This will make it into actual caps but it's not dynamic.  It could be made dynamic with an event listener but it's probably not worth it.

               

              Make sure to change the paragraph style names on the script

               

               

              // By Trevor http://forums.adobe.com/thread/1068926?tstart=0
              #target indesign
              #targetengine main
              app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Capitalise Lists By Paragraph Styles");
              function main()
              {
              var  myDoc=app.documents[0],
                     myStyles = ["Paragraph Style 1", "Paragraph Style 2", "Paragraph Style 3"], // change to correct style names
                     l = myStyles.length, myFinds = [], fl;
                     
              app.changeGrepPreferences = app.findGrepPreferences = null;
              app.findGrepPreferences.findWhat = "^\\l";
              while (l--)
                  {
                  app.findGrepPreferences.appliedParagraphStyle = myDoc.paragraphStyles.itemByName(myStyles[l]);
                  myFinds = myDoc.findGrep();
                  fl = myFinds.length;
                  while (fl--) myFinds[fl].contents = myFinds[fl].contents.toUpperCase();
                  }
              }
              
              • 4. Re: Change case of first character in lists in InDesign CS6
                xsurfergirlx Level 1

                Thank you Trevor, this is exactly what we need!!

                Now the challenge is to ensure everyone actually remembers to run the script...

                • 5. Re: Change case of first character in lists in InDesign CS6
                  Trevorׅ Adobe Community Professional

                  Glad it's what you were looking for.

                   

                  I can't remind you to run the script but I can remind you to mark it as correct.

                   

                  Thanks,

                   

                  Trevor