Backup Custom Metadata?

Is there a way to backup/restore custom metadata?

I’ll explain the need.
I use custom metadata extensively for documents indexed from shared Dropbox folder. From time to time it happens that someone does something prohibiting with one of Dropbox subfolders, index brakes, and all CMD for these files disappear. You can reindex these docs, no problem, but it won’t get back your precious metadata (
Like it was today with some 30 documents…

Any solution to this situation?

Here is a little script, which creates the TSV archive with custom metadata:

tell application id "DNtp"
	if (count of (get selection)) > 0 then
		set theRecords to (get selection)
		set theGroup to incoming group of the current database
		set theSheet to create record with {name:"Archive", type:sheet, columns:{"UUID", "Filename", "CMD"}} in theGroup
		set theRow to {}
		repeat with theRecord in theRecords
			set the end of theRow to {uuid of theRecord, filename of theRecord, custom meta data of theRecord}
		end repeat
		set the cells of theSheet to theRow
	end if
end tell

The problem is that CMD column in resulting TSV is converted in such a format, which I don’t know how to convert back to restore CMD later…

@cgrunenberg, is there an algorithm to convert it back?

There is no algorithm to convert from your sheet to custom metadata.

Look at the dictionary entry for add custom meta data.

Not sure I understand how “add…” function can help it out…

You set the custom metadata as a value in a cell in a sheet.
You said you want to convert that cell value back to a metadata attribute in Preferences > Data*.
That could be done with the add custom meta data command.

DEVONthink stores its custom metadata also as extended attributes (if supported by the filesystem), therefore ex/importing such a file should retain the metadata. However, I’m not sure whether Dropbox finally supports these attributes.