How to generate tags from a list of names

I have a genealogical document collection of over 10,000 files (mostly jpg and pdf) that I want to index and tag in DT3, including tagging with full name(s) of the relevant individuals. While I can fairly easily tag files in bulk by surname in the Finder, by searching in the filenames for each surname, specific full name tags are another story. Needless to say, manually creating DT3 tags for the thousands of names in my genealogy software would be tedious to say the least.

Is it possible to import into DT3 a CSV list of names, with birth and death dates, and use a script ot generate a tag for each individual, e.g., “Doe John A (1850-1930)”? Ideally, these name tags would be grouped into surname tag groups. Then, tagging each document would be a matter of selecting the relevant pre-existing name tag(s).

I’d appreciate any ideas on how to accomplish this.

Is it possible to import into DT3 a CSV list of names

Do you actually have this CSV already created?

Not yet. I wanted to see if it was going to be feasible before determining the appropriate scope (I’ll have no need to tag, say, the in-laws of my 5th cousin 4 times removed) and exporting a list from my genealogy software.

Handling CSV data via AppleScript is certainly attainable. Here is a simple example I wrote (though it was for a different purpose):

This is a pure AppleScript approach, though there are also other methods I could have used.

OK, I get the general concept, but I’m not creating records that are documents with tags; I want to create records that are tags themselves. So instead of “create web document from…”, would I need to use “create record with” and specify properties Kind:tag and Name:(name from the CSV list)? The syntax needed isn’t clear from the DT3 AppleScript dictionary.

A tag is just a group inside the tags group, therefore the syntax would look like this…

create record with {name:"New Tag", type:group} in (tags group of current database)

However, this could create lots of duplicate tags, therefore better might be …

tell application id "DNtp"
	set theDatabase to current database
	set theLocation to "/" & (name of tags group of theDatabase) & "/" & "New Tag"
	create location theLocation in theDatabase
end tell
1 Like

Thanks! I’ll have to experiment with this a bit, but it looks like either approach would work. The data I’ll be turning into tags should have few or no duplicates, because of the combination of first and last names with birth and death years.