Help With Inserting Actual Word Count Value On A Note

What I’m trying to do

I am trying to make a progress bar with the Dataview plugin. The said progress bar will show 100% completion once the actual word count of a particular note (updates automatically) I’m working on is equal or greater than my target word count.

So, what I’m trying to do is finding a way to insert the actual word count value on my notes. Is it possible?

Things I have tried

Since I’m using the Better Word Count plugin, I tried searching its main JS file for leads, but nothing… or so I thought since I have very limited knowledge in JavaScript.

Thanks!

According to this link: [Feature Request] Functions and Statistics accessible by other plugins like dataview · Issue #62 · lukeleppan/better-word-count · GitHub , there is currently no API to get the word count from this plugin.

However, it should theoretically be possible to lift the value of the currently active document directly from the output value within the window. This would require some knowledge in locating DOM elements, and lifting its value using javascript.

Most likely the best way would be to fork that plugin, and add some code to it when it updates the values in the status bar to also check for a target value of the word count and indicate this somehow.

Either of these alternatives does require some knowledge of Javascript, though.

1 Like

Oh. Thank you so much!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.