Import a list of tags

I’m about to start a new project in DTP. I’ve already got a long list of tags that I would like to use with this new data (lists of people, organizations, places, etc.). Is there some way of importing this list into DTP as tags or do I have to enter them one at a time?


The script below is my rewrite of this contribution from @nestor: Tags from content?

-- create tags from text of this document
-- be careful with what the content of the document is
-- you can create a lot of unwanted and unstructured tags this way
-- based on @nestor:

tell application id "com.devon-technologies.thinkpro2"
		--get the current selected entry
		set thisSelection to (the first item of (the selection as list))
		--get the current selected text
		set allTags to selected text of window 1
		--split the text into tags
		if allTags is not "" then
			set {od, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "\n"}
			set theTags to the tags of thisSelection
			set theTags to theTags & (text items of allTags as list)
			set AppleScript's text item delimiters to od
			set the tags of thisSelection to theTags
		end if
	end try
end tell

Use this carefully. It will take all the text of a document and make it into tags, breaking the tags at line breaks. There is no intelligence to this, and so you might end up with a lot of junk tags. Import your external tag list as a list in a plain text document.

Thank you! I’ll experiment with it and learn more about DTPO (just upgraded) in the process.