Is Auto tagging at all possible?


I have been scouring the internet to try and see if I can do auto tagging for my files, but can’t find how to do it. The closest I have come to is dragging keywords from the “Words” sidebar, but when I do, the numbers (frequency, weight, etc) come along as well, which make it really difficult to tag my files.

How can I tag my files without having to type each and every tag?


If you’re using the same tags all the time, then you could also use drag & drop to the Groups & Tags panel or the autocompletion of the Tags bar. But if you’re creating new tags frequently, then the only possibility is probably to write your own scripts.

I would be curious what is involved in “auto tagging”? Apply the same tags to every file? Have some sort of intelligence decide which tags should be applied depending on name and/or file content? Have short cuts for tags?

We tried this at Ironic Software in Yep 1.x. It “worked” to a small degree but it was fraught with typical issues stemming from computers being very literal and their inability to abstract information. So obviously we’d end up with Tags that were “unexpected”. The option was abandoned for Yep 2, Leap, etc.

Criss could likely make a smarter version, but I still think there would be a lot of unexpected results - leading to User cleanup (and lots of Support Tickets :mrgreen: )

The next maintenance release will support this.

well, kinda like the keywords pane, with a hotkey to apply the top 5 tags to the document perhaps?

As it is, even clicking the keywords of a document does nothing… I would have imagined clicking it would apply a tag to it.

Not sure if my previous reply went through, but surely, it would be easy to take advantage of the current technology and implement a menu item that can quick-tag a document with the top 5 keywords? At the moment, the list of keywords is awesome - the function is already there, but if there was some way to just click it or drag it to form a document tag, that would be awesome.

Clicking a word highlights its occurrences in the document (supports text, web and PDF documents), double-clicking searches the word in the database.

Just save this script in the folder ~/Library/Application Support/DEVONthink Pro 2/Scripts (or in one of its subfolders) and it’s accessible afterwards via the Scripts menu:

property pMaxWords : 5 -- Use up to 5 keywords

tell application id "DNtp"
		set theSelection to the selection
		if theSelection is {} then error "Please select some items."
		repeat with theRecord in theSelection
			set theWords to get concordance of record theRecord
			set numWords to count of theWords
			if numWords > 0 then
				if numWords > pMaxWords then set numWords to pMaxWords
				set tags of theRecord to (parents of theRecord) & (items 1 thru numWords of theWords)
			end if
		end repeat
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
	end try
end tell

awesome, thank you, you are a genius. How do we do the same script for just words sorted by frequency (without “the”, “and”, “is”, “etc”)? Do we switch the concordance command to just words?

You could append “sorted by frequency” to the line…

set theWords to get concordance of record theRecord

…but the command doesn’t support filtering of words.

And for anyone playing along at home: This is the Words icon the Concordance), not the Keywords icon being referred to in the previous conversations.

(Sorry, I was a bit confused - and maybe someone else would be.)