Schedule export filtered by tag? (Script or Automator?)

I’m storing files for my family members in Devonthink. These family members do not have direct access to my Devonthink database.

Therefore I want to create a daily export to a local Onedrive folder so my family members can read these files.

So files tagged with ‘Son’ need to be exported to local folder : Onedrive\Family\Son\BackupYYYYMMDD\

Files tagged with ‘Daughter’ need to be exported to local folder :

Is it possible to create a script to do this automatically every day? I’ve been looking into the Devonthink Automator actions but don’t see a way to filter on tags.

Any suggestions?

Why not use the Server feature in DEVONthink Pro Office?

Or you could store the files in the OneDrive folder and index them.

Because I don’t have the Pro Office version. And I don’t want to activate a webserver on my Mac. It would be easier to just export the files to a Onedrive folder and let the Onedrive agent sync the files to their tablets / phones.

That’s also not an option. The Devonthink database is the central hub of all my documents. Documents should be exported to one or more Onedrive folders based on the tags.

So it’s not possible to use Automator or Apple script to export files to a folder based on a document tag?
I always thought Devonthink was fully scriptable…

It is fully scriptable. What have you tried so far?