This AppleScript adds PDFs from Zotero to DEVONthink (only when they are not in the database yet).
It imports into the current group and compares to a specific database.
Zotero stores PDF in subfolders with random names. The subfolders are located in the user defined Zotero root -> storage. This setting cannot be changed as far as I know.
Note that the stored PDFs are mixed with other stored data from Zotero.
…/zotero_base_path/storage/A4KJSLAJ/file1.pdf
…/zotero_base_path/storage/AKJ7HHAH/file2.pdf
…/zotero_base_path/storage/34jh5lhj/file3.pdf
…/zotero_base_path/storage/KSJFH6KS/something.html (!)
This Apple script does the following:
- iterate over all subfolders
- add only PDF files to DEVONthink
- check if there is a similar file in DEVONthink already
- if yes delete the added file
- Add the path to your Zotero
storage
folder in POSIX form ("/path/to/folder") - Add the name of the database where your papers are stored
- Export as script and place in target location (e.g. scripts folder of an application)
- Copy the AppleScript to your scripts folder (Scripts -> open script folder)
- You can choose either the Menu or the Toolbar
Run the script from menubar or toolbar.
NOTE
- The script imports files into the current group
- It compares only to files in the defined database
- If you store papers in database A but compare to a database B you will import duplicates
- I use a specific 'import' group in my paper library
- add bibliographic metadata
- The script always adds all PDFs. Comparison happens after adding a PDF and if it exists already the file is deleted from DEVONthink again. Thus, run time grows with number of papers and might be to slow for very large databases. For hundreds of papers it finishes within seconds though.