Saturday, November 8, 2008

Exclude Comments from Google Docs Word Count

Google Docs has no way of excluding comments (from the Insert > Comments menu, or Ctrl-M) from a document's word count. This bugs me; for NaNo, I want to know my real word count, not my story+comments fake word count. I sent in a suggestion to the Great Google, but there's no guarantee that they'll ever decide it's worth implementing a "word count minus comments" option.

So I took it upon myself to write a Greasemonkey script that toggles comments in a Google Document. When comments are hidden, they won't contribute to your word count.

Technically, I manage this by stuffing the comment text into the comment <span> element's "title" attribute and deleting the text content of the comment. Toggle again and the title repopulates the text content. This makes sure the comment text is never actually removed from the HTML source of your document, which is what Google saves.

I sorta doubt that any other Wrimos (that's a participant of NaNoWriMo) will use my script, but I will use my script, and that's all that really matters. :)

1 comments:

Giynlith said...

Speaking of people using the stuff you code... a friend of mine said he found the Microsoft Online Help Files to be very helpful. :)