var docParCount = app.documents.everyItem().stories.everyItem().paragraphs.length; // paragraphs
... count the paragraphs.
But in Indesign (F8) we can see the character count, word, paragraph... but only counts paragraphs with text, no line breaks without text. How I can get this with a script?
any kind of GrepSearch?
app.findGrepPreferences = null;
app.findGrepPreferences.findWhat = "^.+$"; //or ".+\r"
var _myGrep = app.activeDocument.findGrep().length;
Thanks, but "search" (grep/text) is very slow with large documents...
@Marcos – be aware, that with your line of code in your question you'll never get to footnotes or tables in stories or nested tables in tables or tables in footnotes…
I really think the best way for scripting that would be a GREP search. If it's too slow, I fear you have to write a C++ plugin.