I use Zotero to manage scientific papers because it can download/rename PDFs automatically. The PDFs are stored in subfolders with random names. This setting cannot be changed unfortunately.
I would like to import all PDF files from the subdirectories into one folder in Devonthink. Ideally, I would like to import only PDFs which are not in the database already (i.e. skip duplicates).
I have used Devonthink a lot but never scripted anything. Is it possible to create an import script for my use case?
Indexing might be nonetheless an option together with smart rules (“Zotero” is the indexed group on the screenshot, “Target” is the desired destination for the imported documents):
PS: When posting a gist, you may want to consider saving a copy of the script as text, i.e., an .applescript file. This will show the code in the gist instead of requiring a user to download the script. They can examine it and copy / paste into a new script if desired.