3 Replies Latest reply on Aug 3, 2009 7:41 AM by Dave Saunders

    Word Count - ignore numbers and symbols

    littlemookie Level 1

      Hi Guys,

       

      can anyone tell me how to ignore numbers and symbols by adjusting the script below, i.e., just counting letters in a whole document.


      myDoc = app.activeDocument

       

      h = 0

       

      for ( var j = 0; myDoc.stories.length > j; j++) {

       

      h = myDoc.stories[j].words.length + h

       

      }

       

      alert("You have " + h + " words in this document" )

       

      Cheers,

       

      Samuel