
If( table ) table.asTable().getCell(1,5).setText(count) Įlse if( child.getType() = DocumentApp.ElementType. You can see how many words and characters you have written by pressing Shift+Ctrl+C in a Google Docs document, but this interrupts your. Var doc = DocumentApp.getActiveDocument() įor( i=0 i=0 j- ) ) // incase of double spaces So again you can see there are a lot of things to consider in word counting.įixed for case if paragraph starts with highlight. But, something I observed if a word ends in a punctuation mark and it is not highlighted it counts as a word. I've edited the script to omit from count if words are highlighted in yellow. The first option is to go to Tools in the menu bar and select Word count. The subject of word count has come up before on stackoverflow without a fool proof counter.īasically it skips the header, keeps track of the following table to fill in the word count then counts the words between the table and next header. Locating your word count is an easy task to do and there are two ways to do it. If there is a tab or some other character the count may be off. The word count may not be accurate as this script only uses a space as a seperator between words. I've developed a script for your specific situation. I am running Lubuntu 20.04LTS, using Chrome as the browser, if that makes a difference. There are a few small additional things to consider but just knowing if that's possible would be great. Here's a link to a document showing what I'm hoping to do: link Is there any way to have a cell of the table look at the text below and calculate the wordcount?Įach table has a H3 title above it, so my thought would be to somehow identify and count words that are between the end of the table and the next H3.
#Word counter in google docs update
Some of these documents have dozens or even hundreds of these individual sections (table, with text below until the next table) so having some way to automatically update that field would be incredible. Then if I edit the section below, I repeat that process. When you close the document, the word counter display will be deactivated again and you will need to turn it back on each time you open the document if desired. The word count in Google Docs is displayed in the lower-left corner. Check the option that says Display word count when typing. The table has columns with various info, but one of them is "words" and currently I have to manually highlight that section below, go up to the "Tools" find "Word Count" and then see what it is. Select Word count from the Tools option at the top. I'm using a text doc that has a bunch of tables and each table has a paragraph, two, three of text below it, not as part of the table itself. What I'm looking to do is NOT in Google Sheets, but regular Google Docs wordprocessor.
