More Wordcounting Shenanigans (Win 11)

I’ve noticed a weird flip-flopping in my wordcounts from day to day. In a seemingly random pattern, my total wordcount for my writing project will change by between 1000 to 2000 words.

Yesterday my wordcount was around 46000, and I wrote around 300 words. This morning, my total wordcount was around 48000 (the correct count). So I checked the Writing History, and the record there seems to reflect this flip-flop: it says I removed 1507 words from my project yesterday (I know for a fact I did not, I wrote around 300 words, and that’s it), and it says I wrote 3350 words today (I know for a fact I did not, I wrote around 1500 words today), so it seems like when this flip-flop in the wordcount happens, that ephemeral change is also captured in the Writing History record. So yesterday it was showing 1500 words fewer in my totals, and the Writing History reflects that “loss” of 1500 words, and today it added them back in, as if I wrote them new today.

Something very funky is going on with the wordcounting algo in this program. Is anyone else experiencing the same thing? Is this a known bug, perhaps?

My leading theory is this: My Scrivener project is located in a Dropbox folder (for backup safety), and I suppose Dropbox syncs randomly throughout the day. If it were to happen that Dropbox accesses a particular file right as Scrivener is trying to do a full wordcount across the project, could it be that Scrivener experiences an access issue with that file and skips counting its words?

Does anyone have some experience with this? Is there anything I can do? (apart from pulling the project off the cloud – that’s kinda important to me to have a backup and not just having the project on my local hard disk)

Thanks for any feedback and/or assistance.

You can keep the project’s backups in the cloud without putting the entire project there.

Dropbox should defer to the active application when it encounters files that are in use. If it doesn’t, that’s an issue for Dropbox support.

Make sure that neither Dropbox nor any other service is storing any portion of the project exclusively in the cloud. iCloud Drive in particular is somewhat notorious for yanking files off to their servers without warning, but I wouldn’t put it past OneDrive, either.

Is Scrivener closed when you’re not actively writing?

Thanks for your response!

I’m sure Dropbox would defer to Scrivener if it tries to sync a file that’s already getting its words counted at that second, but what if Scrivener tries to count the words on a file that is already in the process of getting synced? I would imagine that deferral would go the other way too. The difference is likely to be on the order of milli- or even microseconds, depending on who gets to the file first.

If Scrivener were made to be a little more robust on the wordcounting algo (keep a list of files to be counted, check them off as you go, if one gets skipped due to an access issue, chuck it back in the queue and/or retry after a second or two, keep retrying until you get a value instead of an access denied message etc.), this issue could probably be resolved quite trivially (IF this is the issue, I’m just guessing at this point, but it does seem to fit the symptoms).

I don’t think I’m terribly good at always closing Scrivener when I’ve finished for the day (when Interrupted I’m always hopeful that I’ll return in 5 minutes to write some more, and then one of those interruptions just becomes the last one for the day by chance). Is there something in the closing down and opening up of the app that might avoid this issue? Does it do a fresh wordcount on open? (Still not sure how this would prevent a potential access clash with Dropbox, but maybe there’s something about the process I’m not understanding fully).

Scrivener’s wordcount statistics are updated “live,” as the project changes. I’m not sure how it could be more robust than that.

So the question becomes, what is causing Scrivener to believe that 1500 words disappeared, then came back?

Dropbox accessing a file shouldn’t matter. Dropbox (or anyone else) moving the file off the disk entirely might.

As a test, do as @kewms suggests–move the project out of Dropbox, while keeping your automatic backups pointing to Dropbox. If the problem continues, then you’ll know it’s not Dropbox-related.

Check out setting File > Options > General > Startup > Automatically quit after an inactive period of: As long as your PC doesn’t go on standby, this setting will close Scrivener after your specified period of inactivity.

Best,
Jim

1 Like

Thanks, I’ve set that setting – might get me to stop interrupting my work so frequently, haha.

Also I’ll try moving the project off the cloud and the backups onto it. The reason I’ve never done it that way around is of course that that’s the way L&L themselves recommend it be done (backups offline, live project online).

This might be helpful for pinning down where the error is coming from, but it doesn’t seem like a long-term solution (if, say, the error disappears now), because then I can just never sync and work on my iPad when away from my computer and also trust my wordcounts at the same time? That seems a little unfortunate.

Initial test still has the discrepancy, and I’ve noticed something: the wordcount showing at the bottom of the editor when I’ve got my whole draft selected is now consistently showing the lower count (48020 words), but when I click on that area, a popup comes up that shows more info like character count, sentence and paragraph counts etc, and that shows the higher count (50069 words). I’ve manually gone through the files in my draft and added up the wordcounts, and it comes out to the lower count. The higher count matches what I see when I pull up Project >> Statistics >> Selected Documents tab.

So my question becomes: what’s the difference in the way the Project Statistics panel counts the words for all the currently selected docs vs how the Scrivenings mode editor bar counts those same words, because there’s clearly a 2049-word difference.

You might try looking at the Outline view with the Word Count column enabled. You can use that to drive a Scrivenings session and see exactly where the discrepancy is.

Generally speaking, having the Scrivenings count be lower than the Project Statistics count suggests to me that there is text in a Folder document, and you’ve enabled the option to not show that text in Scrivenings. You’ll find the setting in the Scrivener → Settings → Behavior → Folders & Files tab.

It’s a troubleshooting step.

However, you should be aware that iPad words will not necessarily show correctly in Win Scrivener’s Writing History. The count for words that are actually in the project should be correct, but the history of how they got there may not be.

I’ve not yet had enough coffee this morning, but is this not backwards? Your Scrivener project files should be all on the local disk and if in a folder that syncs with an internet service, that service should be set to keep files offline.

2 Likes

To clarify:

If one is sharing a project between devices using a “cloud” service, then that project will necessarily be “online” in the sense that it is in the cloud service’s designated folder. In that situation, it’s a good idea for the project backups to be elsewhere, either exclusively on the local disk or with a different cloud service.

However, the cloud service should be configured so that the entire project is “available offline.”

If the project is not being shared, however, storing the project locally and the backups with a cloud service is an equally valid and potentially safer approach.

These days, the number one most common “data loss” issue I see is that a cloud service has whisked the project (or part of it) away to their server, making it inaccessible to Scrivener. If a cloud service doesn’t have access to the project, it can’t do that. So if you aren’t using a cloud service for sharing purposes, there’s no reason to put the project there and one big reason not to.

Certainly if you’re wanting to sync your project between different computers the cloud files should be set to appear offline to allow Scrivener to access them, but that’s different from the discussion here, which suggests I keep my project files out of the cloud backup folder altogether (so just on my hard drive), and then set my Scrivener backups to be made into the cloud folder (to have some measure of safety from my local computer breaking down).

This is counter to the general advice (seen here, list item 4: Using Scrivener with Cloud-Sync Services / Cloud Syncing / Knowledge Base - Literature and Latte Support) which suggests keeping your live project in the cloud but setting your backups to be saved on the local machine hard drive (so that each computer you use will have its own set of local backups that are not in the cloud).

But as we’ve established, this is merely a troubleshooting step, the intention isn’t to do this permanently.

That advice is written specifically for people seeking to share their projects between devices.

1 Like

Yes, I’ve noticed this, and it’s kinda why I stopped writing on my iPad. I need reliable metrics of my productivity to stay motivated. If I can get this discrepancy sorted out, I can probably return to writing on my iPad sometimes, with the caveat that I need to sync back to my PC properly and then check the wordcount progress in whatever specific way I need to do it to avoid this 2000-word variation from day to day.

I am looking to share my project between devices, as soon as I can be assured I will be provided reliable wordcount metrics to understand my progress. Until then, I’m more or less too afraid to get too fancy with my setup, because the app can’t seem to keep its numbers straight.

I’ve tried this setting, to no avail. I did also check the only 3 folders involved in my draft, and there is a total of 74 words in the top-level one, and nothing in the other 2. These 74 are correctly reflected in the wordcounts, but that still leaves a discrepancy of 2049 words unaccounted for.

I’ve set my outline to have the wordcount showing (I always work like this) and manually counted up all the words shown there, and it amounts to the lower wordcount, so in that sense the Scrivenings count is correct. I’m not sure where Project Statistics is finding the extra 2049 words… and thus I’m also not sure which of these two numbers to take as my actual wordcount.

Project Statistics can optionally count comments and footnotes, neither of which will appear in the Editor count.

If you need an exact count, for instance because a publisher has given you a limit, the best choice is to Compile to whatever your destination format is. Word, for instance, will give a slightly different number from Scrivener.

1 Like

As a test I compiled out to Word, then opened the file in Google Docs, and the count there is 49980, only 89 words down from the higher count that Project Statistics is giving me, and still 2000 words higher than Scrivenings mode is giving me, so seems I can rest assured that the higher count is “more correct” (yay for my wordcount progress, not so yay for figuring out what’s going on with Scrivenings mode and its wordcount losses).

So because I’m totally anal about things like this, I’ve scrolled through the Scrivenings mode and the Google Doc side by side, intent on finding where those 2000 words are hiding, and I’ve come across what seems to be an actual bug in Scrivener, independent of various settings for including/excluding footnotes and comments and whatever.

One of my files has 1027 words in it (according to Scrivener’s own count when I select them: “Selection: 1027 words” down in the status bar), and this is confirmed by Google Docs when I copy all the contents of that file over there (1024 words). BUT, the Total Words column in the Outliner claims that file only has 840 words in it.

So I’ve got this weird situation where when I have that file opened by itself in Scrivener, and I select all the text in it, the status bar says “Selection: 1027 words (of 840)” lol

If that were to happen 11 or so times across the 70 files of my project, that’ll easily account for the 2000-word discrepancy.

I could rejiggle it by typing a couple of extra words into that file and deleting them again, and that refreshed the Outliner’s wordcount but only for that particular file: my wordcount discrepancy is now 187 words smaller. That implies I’ll have to go through every single file, check for this discrepancy, and type and delete some words in each broken one to ensure they’re all set to the correct wordcount.

I’m hoping there’s a more efficient way of forcing Scrivener to refresh all file wordcounts in the Outliner/status bar at once? (Just found another one: “Selection 1196 words (of 530)”, yikes).

If you’d like for us to look at this in detail, please open a support ticket, here:

Attach a ZIP backup of the project.

1 Like

Thanks, I might do that if I can figure out a way to get the project duplicated and stripped down to only one affected file, but here’s the weirdness: The mere fact of me duplicating the project, renaming the folder and .scrivx file to “Wordcount error demo” and then opening that new project has actually refreshed ALL the document wordcounts in the new project (so they’re all correct now), and then when I closed that one and went back to my original, all of those doc wordcounts have now also been corrected.

Fascinating. It’s not the plain Scrivener restart that fixed it, because I’d done that a handful of times during my troubleshooting, and it never fixed it. It seems to have been more the fact that I switched over to a different project, then back again, as if Scrivener maintains a single global cache of document names/IDs and their wordcounts, and only refreshes it when it loads up a completely different project.

Welp, guess it’s resolved for now, though I’m wary of it happening again. I’m thinking if I train myself to use the Project Statistics consistently and completely ignore the status bar wordcount, I should be fine going forward. I might check those two numbers against each other now and then to see whether I get a discrepancy again – the status bar is just so damn convenient for checking wordcounts lol.

Thanks for you patience and assistance, it’s much appreciated.