Find instances in file that matches instances in folder and create replicants

Hi,

I use Zotero and I’m trying to find a good way to mirror collections in Zotero with groups in Devonthink.
I have all my attachments in Zotero indexed by Devonthink.

My idea:

  • Create an html export file in zotero with information about the Zotero collection
  • Run a smart rule (script) on a folder of choice in Devonthink that scans the html file from Zotero and find all attachment references in that file (.pdf .md .docx). Match those references with my indexed Zotero attachment folder (and subfolders )and create replicants of those files into the folder of choice.

Is this possible using a smart rule on a folder? And how do I set up such a rule and how does the script look like (if I dear to ask)?

:grinning_face_with_smiling_eyes:

  • Do you have such an HTML file?
    • The files will be replicated to where?

The files will be replicated to the active group in Devonthink. I create a new group or choose a group and run a smart rule on that group.

BTW I found out I could generate a simple Bibtex Citekey txt file that contains the citekeys for the instances in the selected Zotero collection. Since all my attachments start with citekey in the name, I believe that this file is a better option than scanning a html file. This is how it looks like inside the file:

@barton2018; @benner2015; @clinton1988; @clinton1989; @hagberg2005; @ml530videos; @reese2012; @stanley1992; @stathanasiusofschaff2018

Example of filename:
reese2012 Deep mentoring.pdf

Notice that there is no @ in front of citekey in pdf filename.

Wouldn’t you have multiple documents with reese2012 in the beginning of the filename?

If so it is fine to match all documents with that citekey. I normally create new instances in Zotero with a unique citekey for each document. If it is the same author and date for the different documents then Zotero will create a citekey with an addition, e.g.: reese2012a

I also have markdown files with the same citekey, typically when I make notes for that source. The rule should include what file type to find that matches citekey.

Using Better Bibtex in Zotero with citekeys and use it in filenames is a great way to connect files that belongs together.