My Google Writing Tracker Scripts Now Available on GitHub

Lot of people have asked if would make the code for my Google Writing Tracker scripts available. I’ve been saying “eventually” long enough. As of this morning, the core scripts are now available on GitHub.

A few comments:

  1. These are unsupported scripts. I say this not because I don’t think they will work (I’ve been using them flawlessly for months) and not because I don’t think there will be bugs (there always are), but because I have no time to support them. This also means I can’t help you install the scripts. Use this scripts at your own risk. If you use them incorrectly, you can lose work.
  2. Read the documentation. The setup is a bit cumbersome, and needs to be precise, but once the scripts are setup, and as long as you follow the directions, the system should work well.
  3. The scripts are licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you are a coder and want to make changes or add your own stuff, by all means have at it!
  4. The first scripts released will keep track of your daily word count and send a HTML email message of your daily writing (adds, deletes and changes) to an email address if your choice (you can use your Evernote email address if you want these to go directly into Evernote). The scripts do not include my Daily Almanac scripts. Those are way too customized for me right now and I don’t have the time to generalize them. Eventually, but not anytime soon.

Once you’ve got the scripts setup, the process becomes easy. Do all of your writing work in the Sandbox folder. Be sure when you are editing a document that you are editing the version in your Sandbox folder and not the version in your Sandbox/Earlier folder. Edits to the latter will be lost. Otherwise, write every day and your word counts and changes should be captured as documented.

I am interested to know how they work for folks, so drop a comment if you end up using the scripts.

17 thoughts on “My Google Writing Tracker Scripts Now Available on GitHub

  1. Very nice! I was working on my own but don’t have a whole lot of coding background so it was slow-going. Thanks a lot!

  2. Thanks very much for releasing this.

    I’m a real stat-nerd and I’ve got a spreadsheet that I use to track this type of data manually but I can’t really track edits properly. I’m using Google Docs and my Chromebook more and more so this has come at a perfect time.

    1. Thanks, Mike. And yes, I read Neil’s new book last month and my review will appear in my book review column for InterGalactic Medicine Show later this month (along with my review of Lauren Beukes THE SHINING GIRLS).

  3. Oh, wow! I was hoping in the next year… :) Happy, happy, joy, joy! Thanks, Jamie. So awesome of you to make this available. I’ll post back, let you know how it works out. *glee*

  4. I got these up and running last night – very useful.

    I did hit some minor bumps along the way so here’s some tips for anyone else trying the scripts.

    – If you don’t see an option in Google Docs to create a new script, you’ll need to install the “Google Apps Script” app. Do that by clicking on the Connect More Apps link at the bottom of the Create menu in Google Docs. Search for ‘script’ and you should get Google Apps Script listed right at the top – just install it.

    – When you create the spreadsheet, put Date in cell B1 not B2 as the docs specify (Step 1c)

    – The instructions mention you can change timezones by replacing EDT with your appropriate timezone. It’s actually EST you need to change.

    – Although there are settings to change the folder used to store documents and histories, they aren’t used consistently so if you do change them the script will break. It’s not a difficult fix if you’re familiar with coding but if not, take Jamie’s advice and use Sandbox and Sandbox/Earlier

    A couple more tips:

    When you think you have the script set up, you can select the code.gs script in the Google Docs script editor and use the Run menu to test it – just select the getDailyWordCount function. Once you’ve finished testing, you may want to delete the files from Sandbox/Earlier and delete the data from the spreadsheet (don’t delete the headings) so you get a nice clean start for your actual stats.

    If you want to start tracking the work you’re doing on a document that already exists without messing up your word count, put a copy of the document into Sandbox AND Sandbox/Earlier. Make sure the filenames are identical. If you just put it in the Sandbox folder, the script will count the entire document as new words and that’s cheating.

  5. Has anyone figured out a way to send the Evernote reports directly to a specific notebook within Evernote? I can’t figure out a way or place to put my Evernote email address PLUS the “@Fiction” command to get the email automatically put in an Evernote notebook I’m trying to use titled “Fiction.”

    Thanks for these scripts. I just found the entry here and all the other terrific information on this blog via Google a couple of days ago.

    (I, too, am trying to work exclusively with a Samsung Chromebook, so having this stuff to handle some basic stat functions within Google Drive is wonderful!)

    1. Gary, the “@fiction” goes in the Subject line of the message. In the original code I wrote, there is a line for this (line 96 as the code stands in GitHub) that looks like:

      var subject = "Daily writing for " + today + " @Writing";

      The “@writing” in that line tells Evernote to file the note in my Writing notebook. Indeed, that is exactly what happens. Each night when the script sends the summary to Evernote I find the summary in my Writing notebook. You can change “@writing” to “@fiction” in this line and should get the desired result.

  6. FYI — Got the script installed, got it hooked up to the “Fiction” notebook in my Evernote account — and everything seems to have worked flawlessly yesterday (the first time I used it). Thank you again so much for this really useful tool!

  7. OK, is it just me or has something happened to make the scripts stop working? As of October 31, I believe, nothing seems to be registering as added words in the Spreadsheet, and nothing is being sent to Evernote showing document changes.

    I seem to have some sort of “shared” file that goes into great length about why Google scripts may be broken. That came to me Oct 31.

    Unfortunately, I cannot make any sense of that information in relation to these writing scripts. It might as well be in Greek for me! (Actually, I’ve had a couple of years of Greek in Bible college years ago, so I might understand more if it were in Greek. LOL!)

    1. Gary, the scripts are running fine for me (and ran last night). It sounds like the script was running for you and then stopped working beginning on October 31. Is that right? It’s possible that you need to recreate the trigger that the script uses. In the instructions on GitHub, this can be found in part III: Configuring the Automation. I would suggest deleting the existing trigger and then recreating it using those instruction. I’ve had my script fail two or three times since I started using them because the trigger didn’t run, but it always ran on the next day without trouble.

      1. Will this script work if I have more than one work in “Sandbox” at a time? I have a short story there and I have a novel draft in there.

        I had the short story in there and the script was tracking and sending to Evernote email just fine. But the day I added the novel draft, then worked on the novel but not on the short story — nothing is tracking. I get zeros in the spreadsheet each evening and nothing shows up in Evernote.

        Maybe I’m not understanding something about it all. Guess I’ll try taking the novel out, work on the short story, and see what happens then.

Comments are closed.