Creating an index of topics using tags in DevonThink?

In reading Cal Newport’s latest book Digital Minimalism does anybody know of a way to automatically tag items in Devonthink Pro? I do research for fun and use it in other reguards and would make like easier. Maybe something like “if in this folder add these tags”? Otherwise would this be something instead for Hazel?

Documents in DEVONthink inherit the tags of the group they belong to. So if group “A” has a tag “Banana” then a document placed in “A” will have the tag “Banana” as long as that document is stored in “A”. So, this is one way to, in a sense, autotag documents.

Another, more permanent way, is to attach a script to a group that autotags the contents of the group whenever the group is opened. For example:

on triggered(theRecord)
	try
		tell application id "DNtp"
			set theSelection to the children of theRecord
			repeat with thisItem in theSelection
				set the tags of thisItem to the (tags of thisItem) & "my tag" --<- add your own tags here
			end repeat
		end tell
	end try
end triggered

This script puts persistent tags on the documents added to the group – so when the document is removed from the group, the tags stay assigned to the document. Note the special syntax for a triggered script. (Very complex processes can be added to a triggered script, by the way.)

Compile and save the script somewhere, and in Show Info for the group, select and add the script in the “Script” section of "Show Info. There is a shortcoming: you need to select the group (i.e., like you were going to view its contents) in order to trigger the script.

3 Likes