9 Replies Latest reply on Oct 22, 2009 3:09 AM by Coully

    Bold Text

    Coully

      Hello

       

      I am trying to embolden some text which I am adding via a script to a document.

       

      For example:

       

      This is really great.

       

      Is the any way I can 'Tag' text so Indesign will embolden this?

       

      ..or would I have to create my own tagging system ....This is <bold>really</bold> fun   ...?

       

      any ideas would be much appreciated. If it's the latter and someone had an example of how, I would really appreciate it.

       

      Thanks

       

      Coully

        • 1. Re: Bold Text
          Techi Panda Level 2

          Hi coully

           

          you can try this, this works in CS3

           

          create bold CharacterStyle

           

          var myTextFrame = app.selection[0];
          var myStory = myTextFrame.parentStory;
          app.findGrepPreferences = app.changeGrepPreferences = null;
          app.findGrepPreferences.findWhat = "<bold>([A-z]*)<\/bold>";
          app.changeGrepPreferences.changeTo = "$1";
          app.changeGrepPreferences.appliedCharacterStyle = 'bold';
          myStory.changeGrep();
          app.findGrepPreferences = app.changeGrepPreferences = null;

           

          thanks

           

          regards

          a r u l

          • 2. Re: Bold Text
            Coully Level 1

            Brilliant cheers arul.

            • 3. Re: Bold Text
              Coully Level 1

              Found a weird one to do with this as well.

               

              If the text overflows it only seems to find the bold tags in the first line of the textframe / story. Possibly an Indesign bug? or is this intentional.

               

              I've tried switching all the FindChangeGrepOptions - Includes to true to no avail.

               

              any ideas?

              • 4. Re: Bold Text
                Techi Panda Level 2

                Hi Coully

                 

                can you give me a detail about your problem what you want to do now

                 

                i feel hard to figure out your problem, can you give me some examples

                 

                thanks

                 

                regards

                a r u l

                • 5. Re: Bold Text
                  Coully Level 1

                  Sorry Arul,

                   

                  I'm being a bit vague and I was wrong about the Overflow.

                   

                  The problem I seem to be having is with GREP command itself.

                   

                  The text that I am trying embolden is like this.

                   

                  <strong>Ingredients</strong>: Water, <strong>Orange</strong>

                  Fruit from Concentrate (10%), Citric Acid, Sweeteners (Aspartame,

                  Saccharin), Preservatives (Potassium Sorbate, Sodium Metabisulphite),

                  <strong>Natural Flavouring</strong>, Acidity Regulator

                  (Sodium Citrate), Stabiliser (Cellulose Gum), Natural Colour

                  (Carotenes). <strong>Contains a Source of Phenylalanine.</strong>

                   

                  When I run the script you kindly posted, it only emboldens 'Ingredients' and 'Orange' from the first line?

                   

                  Is this something to do with spaces and punctuation??

                   

                  Thanks mate

                  • 6. Re: Bold Text
                    Techi Panda Level 2

                    you just change the grep tag like this

                     

                    find :  <bold>(.+?)<\/bold>

                    replace: $1

                     

                    thanks

                     

                     

                     

                    1 person found this helpful
                    • 7. Re: Bold Text
                      Coully Level 1

                      Thanks very much Arul. That's great. Sorry one last question mate.

                       

                      One that's getting missed is

                       

                       

                      <strong>www.microsoft.com<strong/> any ideas why?

                       

                       

                       

                      Ignore me it was a typo '/' in the wrong place.

                       

                      <strong>www.microsoft.com</strong>

                       

                       

                      Thanks for all your help arul.

                      • 8. Re: Bold Text
                        Coully Level 1

                        Ignore me arul it was a typo

                         

                        the '/' was in the wrong place

                         

                        Thanksfor all your help arul.

                        • 9. Re: Bold Text
                          Techi Panda Level 2

                          i think there is a problem in your text

                           

                          <strong>www.microsoft.com<strong/>

                           

                          should be

                           

                          <strong>www.microsoft.com</strong>

                           

                          differences in the strong closing tag

                           

                          thanks

                           

                          regards

                          a r u l