7 Replies Latest reply on Jun 27, 2011 11:23 PM by REVA83

    JSX for word count, including tables

    ryan.kiefer Level 1

      Hi folks,

       

      I've tried two different scripts (found on this site) to attempt to get the word count out of an entire book, including all stories, tables, and captions.

       

      The first:

       

      alert("There are "+ app.documents[0].stories.everyItem().words.length +" words in the active document.")

       

      Then this one, which doesn't count numbers and symbols, which I like:

       

      app.findGrepPreferences = null;

      app.findGrepPreferences.findWhat = "[\\u\\l][-\\u\\l]+";

      found = app.documents[0].findGrep ();

      alert ("There are " + found.length + " words in this document.")

       

      The difficulty is that neither of them include words in tables. Is there a way to force this in this script?