Total number of words in a document

Hello everyone,

I have used the “words” sidebar (next to “see also and classify”) but I wonder if there is a way to see the total number of words in a document. This side box appears to show total unique words, but most words have a different frequency.

How can I find total number of words in a document?

Thank you,

-devananda

You can make your own command to do this.

Copy this script. Open AppleScript Editor, paste the code, compile the script, and save it to a folder you create inside:

~/Library/Application Support/DEVONthink Pro 2/Scripts

In DEVONthink, click the Scripts menu (the little scroll in the menu bar), select Update Scripts menu.

Now, when you want the word count of an item, navigate to your script in the Scripts menu and click the script.

tell application id "com.devon-technologies.thinkpro2"
	set thisItem to (the first item of (the selection as list))
	set theTitle to "Total word count of " & the name of thisItem
	set totalWords to the word count of thisItem
	display dialog totalWords with title theTitle
end tell

The script will return zero on some kinds of documents - e.g., bookmarks. I have not verified the accuracy of the word count provided by the script. What the script counts as a “word” might not be what you call a word. E.g., the string “{}” is considered a “word”.

Thanks Korm!

Works great! :exclamation:

Until next time…