Allow AppleScript/Search by word count

I’m not entirely sure how possible it is, but it’d be nice if I could make a smart group of documents with fewer than, say, 100 words – so I could easily segregate the ones that need the most attention.

This might already be doable, but I haven’t found it.

I’m aware that I can do a Search and sort by word count, but I’d prefer to have an AppleScript way of doing it.

/Low Priority

You might have a look at the “Smart Group.scpt” (see “More Examples” in the academy) and use a query like this to retrieve the desired contents:


tell application "DEVONthink Pro"
	contents of current database whose word count is less than 100
end tell

However, this script might be quite slow depending on the size of the database and the number of found items.

Mmm. That didn’t occur to me. Thanks!