Beeminds word counts when you write in Microsoft Word
This is a differential Word counter. It counts what is your number of words you have written from the last time you ran this macro. With minor code modifications, it can be used as cumulative word counter.
- Create IFTTT Recipe: Dropbox (when new file created in a subfolder) -> Beemind datapoint (FilenameNoExt)
- Record Macro -> keyboard
- Assign : ctrl + D (or any other shortcut that you want, but beware that it is not used by Word. Try the shortcut and it should not do anything before creating this macro)
- Type something
- Stop recording macro
- Macros -> Click on Visual Basic
- Your macro will be at the end
- Delete the code that is generated from your typing, and replace it with the code in this repo
- You have to put at the top of the Normal.dot file the public declaration of the variable 'last_wordcount':
Public last_wordcount As Long
Macro can be modified by following the instructions of few comments in the code to make it beeminding cumulative word counts
In differential mode:
You have to run the macro once before start typing
IFTTT Dropbox says: Dropbox trigger: This trigger fires every time any file is saved in the folder you specify. Note: will process up to 15 files per polling period.
So, in worst case scenario, it is better to wait for a minimum of 5 minute before running the macro again. In my experience, every few minutes the IFTTT Applet ran. So this would not be a problem even if you run the macro every 30 seconds.
In order to make it safe, I have included in the differential mode a way to keep the last 10 datapoints
How often IFTTT Applets run? Answer: https://help.ifttt.com/hc/en-us/articles/115010194247-How-often-do-Applets-run- There is variation on how often Applets run, depending on the type of Applet and the service APIs involved. Some will run within seconds, while others may take up to an hour. On average, most Applets run within 15 minutes of being triggered
Even if by chance you have written a differential word count similar to a previous count in the last 10 numbers that is still saved in the dropbox folder, the new similar datapoint will be nevetheless beeminded. Since the code will check for that and will add a different extension to the new datapoint
You have to put at the top of the Normal.dot file the public declaration of the variable 'last_wordcount':
Public last_wordcount As Long
There is a way to uncomment one line and it will make the code ignoring negative wordcounts.
Pros of differential word counter vs cumulative
- Can work on multiple word files with only one writing Beeminder goal. Even if the word files have different folder paths. This method depends on using Macro that is available everywhere when you work on your Word application, and not on the path of your word file.
- Can work when you want to continue writing, even if the writing project started before creating the beeminder goal, and your intention to beemind your effort every session, rather than the total word count of the word file.
- If you copy paste a chunk of text and do not want to include it in your word count, you can copy paste it -> save word and exit -> open it again (it will reset the differential count and you can continue writing and effectively skipped beeminding that pragraph that you have pasted
- A one line code can be uncommented to ignore negative wordcounts, in case that is desirable when you want to ignore deletions. Please remember to run the macro after deleeting a significant chunk of text so that it will count your typing after that deletion.