I am trying to build a custom script based on ~/Library/Application Scripts/com.devon-technologies.think/Smart Rules/Download Bibliographic Metadata.scpt . This script is what powers the “Download Bibliographic Data” smart rule.
The comments in the script suggest that it parses the PDF passed to the script and searches for a DOI string. But the actual code does not look at all like a parser, but as if there was some metadata extraction going on already within DEVONthink:
try
set customMetaData to custom meta data of theRecord
set doi to mddoi of customMetaData
[...]
on error
set doi to ""
try
set doi to digital object identifier of theRecord
… and that’s it.
What is “custom meta data” and “digital object identifier of theRecord” here, how is it filled within DT, and where can I read more details about this in the documentation?
Custom metadata is arbitrary metadata assigned to an item in the database, defined in the Settings > Data, and accessed via the Info > Data inspector. There is a built-in attribute that may have data in it…
Thanks for your quick reply! However, I still don’t get how that custom metadata field is populated in the first place. I see a DOI even for files that I only ever imported into the database and which I did not touch since then. Does DEVONthink analyze document metadata right on import?
Many thanks for your help. While I still have no idea how some of my documents got their DOI field populated, I could now finish the script I was working on (in the context of which this question popped up) and for future documents, I will rely on fetching the DOI from bibliographic databases.