7 Replies Latest reply on Jul 15, 2013 10:40 AM by rajnikids

    Find BulletChar Font

    rajnikids

      HI Forum,

       

      How do i find buletCharacter Font name.

       

      the below script, could find only the font Name of the text wherever the bullet styles are applied. (eg.)

       

      fjldfjdf

      dklfjdlfjd

       

       

      app.findGrepPreferences.bulletsAndNumberingListType = ListType.bulletList;

      //app.findGrepPreferences.appliedFont = "Arial";

      myfound = app.findGrep();

      for (i=0 ; i<myfound.length; i++) {

      alert (myfound[i].appliedFont.name)

      }

       

       

      My intention is to find the font name of the bullet added (Using Paragraph----bullet and numbering---Add (button)--Add bullets----selecting Font family...in dropdownList).

      Please check the screenshot attached.

       

      Screen Shot 2013-07-15 at 11.55.36.png

       

      thanks forum.

        • 1. Re: Find BulletChar Font
          rajnikids Level 1

          ALso i tried using this.

           

           

          app.findGrepPreferences.bulletsAndNumberingListType = ListType.bulletList;

          myfound = app.findGrep();

          for (i=0 ; i<myfound.length; i++) {

          alert (myfound[i].bulletChar.bulletsFont)

          }

           

          Now the Alert is:

           

          Screen Shot 2013-07-15 at 12.45.08.png  this is screenshot is "the paragraphs that has usual bullet and numbering style.

          Screen Shot 2013-07-15 at 12.45.13.pngthis is screenshot is for the "bullet that has been added Manually using the font Zapf Dingbats Font".

           

          the script finds bulletChart.bulletFont and declare as AUTO_VALUE for normal bullets and [object Font] for bullets added using Zapf Dingbats fonts.

           

          How do i, get the font name "zapf Dingbats" as a alert instead of [object Font].

          • 2. Re: Find BulletChar Font
            Jump_Over Level 5

            Hi,

             

            alert (mfound[i].bulletChar.bulletsFont.fullName);
            

             

            but be awared:

            mfound is an array of textStyleRanges, so one element can contain many paragraphs (bullets).

            to alert all of them - iterate through mfound[i].paragraphs.

             

            Jarek

            • 3. Re: Find BulletChar Font
              Jump_Over Level 5

              Hi,

               

              I mean solution like this:

               

              myDoc = app.activeDocument;
              app.findTextPreferences = null;
              app.findTextPreferences.bulletsAndNumberingListType = ListType.bulletList;
              mFound = myDoc.findText();
              l = mFound.length;
              while (l--) {
                        d = mFound[l].paragraphs.length;
                        while (d--)
                             alert (mFound[l].paragraphs[d].bulletChar.bulletsFont.fullName);
                        }
              

               

              Jarek

              • 4. Re: Find BulletChar Font
                rajnikids Level 1

                Thank you so much Jarek!,

                 

                On the reverse,

                 

                How could we Check and get alert, if the applied bullet  is not in "zapf dingbats" FontName.

                 

                thanks Jarek! in advance.

                 

                many thanks

                • 5. Re: Find BulletChar Font
                  rajnikids Level 1

                  Hi Jarek!

                   

                  Here it is, I tried for the options.

                   

                   

                   

                  para = app.activeDocument.stories.everyItem().paragraphs.everyItem().bulletsAndNumberingListType ;

                  if(para.fontName !=="ZapfDingbats") {

                      alert ("check bullet font")

                      }

                   

                  So, I want to check the bullets fonts for Zapf Dingbats, if not, the alert should be produced. if yes, exit.

                   

                  Please help on this..

                  • 6. Re: Find BulletChar Font
                    Jump_Over Level 5

                    Hi,

                     

                    myDoc = app.activeDocument;
                    fontToSearch = "Zapf Dingbats";     // watch a typo errors
                    app.findTextPreferences = null;
                    app.findTextPreferences.bulletsAndNumberingListType = ListType.BULLET_LIST;
                    mFound = myDoc.findText(true);
                    l = mFound.length;
                    while (l--) {
                              d = mFound[l].paragraphs.length;
                              while (d--) {
                                        currFont = mFound[l].paragraphs[d].bulletChar.bulletsFont;
                                        if (currFont.fullName == fontToSearch) {
                                                  mFound[l].paragraphs[d].lines[0].showText();
                                                  alert ("Check this bullet font");
                                                  }
                                        }
                              }
                    

                     

                    Jarek

                    • 7. Re: Find BulletChar Font
                      rajnikids Level 1

                      Thanks so much J!!!!

                       

                      Initially I tried with your solution but missed array [d], that y confused..

                       

                      HOwever your third solutions clear my doubts, and shown me, where i went wrong.

                       

                      thank you verymuch JAREK!!!!!!.