4 Replies Latest reply on Mar 26, 2013 3:57 AM by [Jongware]

    how to find pointSize below 8

    Mahesh_JW Level 1

      Hi All,

      I want to generate a report with page and font name if the InDesign document contains font size below 8 points.

       

      plz reply ASAP.

       

       

       

      Regards

      Mahesh

        • 1. Re: how to find pointSize below 8
          [Jongware] Most Valuable Participant

          What do you have, so far? Or do you need someone to write a custom script for you from scratch?

          • 2. Re: how to find pointSize below 8
            Mahesh_JW Level 1

            Hi,

            Thanks for your reply.

             

            This is what my code, but is this good idea or something in efficient?

             

             

            for(var num=7.9;num>=6;num = num - 0.1){

                      app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;

                      app.findTextPreferences.pointSize = num;

                      var result = app.activeDocument.findText();

             

                      if(result.length>0){

                                for(var a=0;a<result.length;a++){

                                          result[a].select();

             

                                          //report page, font name

                                }

                      }

            }

             

             

             

             

            Regards

            Mahesh

            • 3. Re: how to find pointSize below 8
              Jump_Over Level 5

              Hi,

               

              It should work basically however manually scaled text will be excluded (i.e 6.5435 pt)

              And I suggest to change last line:

               

                    result[a].select();

              to:

                    result[a].showText();

                    alert(a);

               

              to see effect

              Jarek

              • 4. Re: how to find pointSize below 8
                [Jongware] Most Valuable Participant

                As Jarek mentions, this is not a very reliable method. It also would be kind of slow.

                 

                Try using TextStyleRanges -- these are the internal "units of formatting" inside InDesign. Using everyItem, you can quickly gather the list of every formatted block. Then you can inspect each one at leisure:

                 

                result = app.activeDocument.stories.everyItem().textStyleRanges.everyItem().getElements();
                alert (result.length);
                for (a=0; a<result.length; a++)
                {
                if (result[a].pointSize < 8)
                {
                  result[a].select();
                  //report page, font name
                }
                }