Scrivener API for extracting stats?

There are among us freakish folks that love stats. Mostly so we can be cool and track word counts per day, time spent, etc., on our various scrivener projects. One approach I’ve used is to pull out the line matching

Words=

in the scrivx file (MAC), filtering on today’s date ("+%Y-%m-%d"), and storing that number. That works, but it seems a little hokey. Is there an API, or plans to expose one, where we could query to pull out writing stats daily to then do compiling and spreadsheet and graphs (OH GLORIOUS GRAPHS!) galore?

Had to ask :slight_smile:

Thanks!

1 Like

That’s a safe approach, though if your scripting language can parse XML, having it grab the Words attribute from PreviousSession, as well as Date, would be a bit safer as that attribute might get used elsewhere (I don’t believe it is, currently).

There isn’t an API right now, though. This is on the roadmap, but I must stress, the long-term roadmap. :slight_smile:

Honestly, my fu is weak, but my bash (sed/awk) are strong :wink:

It was worth asking, thanks for the super fast reply!

I came here looking for the same answer and it’s almost 11 years later with no mention of a Scrivener API in the manual. I assume it will never be implemented, but curious to know if any part of your roadmap gets published so we know what to really expect?

No, we don’t publish a roadmap.

2 Likes