3 Replies Latest reply on Dec 5, 2014 1:44 AM by Eugene Tyson

    Can I target bold text with GREP - in Paragraph styles dialog box?

    Schmaltzkopf Level 1

      Hi there.

      I have a number of paragraphs that are mainly "regular" (as in font style: regular) but they also have some bold text throughout.

      I am trying to make a paragraph style that will apply a character style to the bold text using GREP.

      Is there a GREP code for that (to only apply the character style to the bold and nothing else)?

      I know that this is easily accomplished in the find/change dialog box, but I am asking about the paragraph style dialog box in the GREP section.

      Any help would be greatly appreciated.

        • 1. Re: Can I target bold text with GREP - in Paragraph styles dialog box?
          vinny38 Level 4

          Hi there,

          It's indeed easy to do.

          You don't even have to use GREP, you can use regular text search/replace query.

          First, create your character style for bold. (Let's call it "CBold")

          Then, create your paragraph style, with your desired settings (Let's call it "PReg")

          Finally, click on the "specify attributes to find" icon, search for "Bold" and replace by both character and paragraph styles previously defined:

          sf.jpg

          That will do the job.

          Please note this will "erase" all text attributes (such as italic...) in your paragraph.

          Also, it will apply changes to all paragraph if no style is specified in searching options: including titles i.e.

          So, be careful when using this method...

          • 2. Re: Can I target bold text with GREP - in Paragraph styles dialog box?
            [Jongware] Most Valuable Participant

            Schmaltzkopf wrote:

             

            I am trying to make a paragraph style that will apply a character style to the bold text using GREP.

            Is there a GREP code for that (to only apply the character style to the bold and nothing else)?

             

            No, there is not. GREP itself is not concerned with text attributes (bold, italic, superscript), and so there are no codes for it.

             

            A GREP Style can only be used to apply a character style to the characters that its GREP expression match.

            • 3. Re: Can I target bold text with GREP - in Paragraph styles dialog box?
              Eugene Tyson Adobe Community Professional & MVP

              Schmaltzkopf wrote:

               

              I know that this is easily accomplished in the find/change dialog box, but I am asking about the paragraph style dialog box in the GREP section.

              Any help would be greatly appreciated.

               

               

              No - the Paragraph Style dialog box allows you to apply a premade character style to some text using GREP code.

               

              GREP code would be something like

              \d+?

               

              Would find a string of digits that are togethere without any spaces or commas, basically it would find, 1 or 11 or 111 or 1111 etc. but not 1,000 or 10,000 it would only find the 1 skip the , then 000

               

              You'd end up with 1,000 without the comma being emboldened.

               

               

              In short - no you cannot find Character styles using Grep Styles.

               

               

              As Vinny38 points out you can do this in the Find/Change and you knew this already.

               

               

              I suggest you should have a all your text with the proper character styles applied - and this little script does that just - creates/applies character styles throughout your document.

               

              http://indesignsecrets.com/perfectpreptext-a-smart-way-to-style-local-formatting.php

               

              How to install and use scripts

              http://indesignsecrets.com/how-to-install-scripts-in-indesign.php