script for adding tags into text files


Is there a script or some other way to add tags into associated rich text files before export to Scrivener or other programs that don’t support Devon-style tags?

Thanks in advance for any help you can provide.

Here’s a simple script to insert the tags into the currently selected & visible plain/rich text document:

tell application "DEVONthink Pro"
	set theRecord to content record
	set theTags to tags of theRecord
	set {od, text item delimiters of AppleScript} to {text item delimiters of AppleScript, ", "}
	set theTags to theTags as string
	set text item delimiters of AppleScript to od
	tell text of think window 1
		make new paragraph with data ("Tags: " & theTags & return & return) at beginning
	end tell
end tell

DEVONthink supports OpenMeta and therefore other OpenMeta applications should be able to read the tags of exported files. However, I don’t know whether Scrivener supports OpenMeta.