1 Reply Latest reply on Jul 25, 2013 5:20 AM by Jump_Over

    Alert needed only once.

    indegn5 Level 1

      HI,

       

      The below script alert for each and every instances of find....

       

      Can i have it to Alert only one once for the document..

       

      try {

      df = app.activeDocument.stories.everyItem().paragraphs.everyItem().getElements();

      for (i=0; i<df.length; i++)

      if(df[i].appliedFont.fontType == FontTypes.TRUETYPE)

      //    app.select(df[i]);

              alert("Fonts")

      } catch (e) {}

        • 1. Re: Alert needed only once.
          Jump_Over Level 5

          Hi,

           

          I suggest to change it:

          var mF = app.activeDocument.fonts.everyItem().getElements(),
          l = mF.length, mFarr = [], mAlert = "no TrueType detected";
          
          while (l--)
               if (mF[l].fontType == FontTypes.TRUETYPE)
                    mFarr.push(mF[l].name);
          
          if (mFarr.length > 0)
               mAlert = mFarr.join("\r");
          
          alert(mAlert)
          

          Jarek