My girlfriend uses Scrivener for fiction writing, and I was recently checking out the features again because miraculously, Scrivener 3 was finally released for Windows and she bought it. (This is a big deal - Scrivener 3 for Mac came out in 2017 and there were times when it seemed like a Windows version might never ship.)

Scrivener is designed really well for solo writing, but when it comes to collaborative writing and commenting, Google Docs is much, much better. This makes it ideal for grant writing, and I’ve had very few complaints using Google Docs as my main writing tool. However, there is one feature from Scrivener that would be really nice to have for grant writing: a way of setting a word count and word limit for each question.

A screenshot of the Scrivener application showing sections with word count targets

Scrivener’s outline view allows you to get a quick overview of how your writing is coming along.

The good thing about Google Apps is that is has pretty extensive scripting support, so I was able to make a script to create wordcounts for each section in a document. You can find the script and its instructions on GitHub, but I also made a quick demonstration video:

As you can see, you can put a word limit in parentheses in the heading, and it will then add and update a word count within those parentheses as well. The word count also gets a highlight colour to serve as a quick visual indicator of how close you are to the word limit.

One thing that’s a bit frustrating is that, unlike in Google Sheets, there’s no trigger you can set up in Google Docs to run the script after you make an edit. So the best I was able to do for now is to provide a menu to run the script on command; in addition, the script will run on a time trigger every minute. (Once per minute is as often as Apps Script allows).

Despite the trigger limitations, it works pretty well, and I’m going to try using it and try to make additional refinements over time. I’m also going to dig deeper into different word count algorithms so that I can make sure the word count used in the script handles some of the odd edge cases in the same way that Google Docs does. I’ve also encountered some cases where grant portals count words slightly differently than google docs, and it would be interesting to try to figure out why.

If you’re looking for a session word count target as a writing motivator (another well-loved Scrivener feature), you can check out the Word Counter Max add-on, which looks like it would also be a pretty useful tool for grant writers.