In developing a script to integrate my Drafts database with other tools, I want to be able to trigger potentially many updates to Drafts from an external (in this case, Python) script.
In particular, I want to:
- Create new drafts (with supplied content and tags)
- Update metadata (archive/trash/delete and apply/change tags) for existing drafts, based on their UUID.
I need to be able to reliably, and hopefully efficiently, do these for potentially many updates at once.
This raises two questions:
- Creating new drafts is easy with the URL scheme, but I find that repeatedly firing the URL scheme too rapidly seems to start failing. (I’m triggering the system URL handler with Python’s builtin
webbrowser
module, but I’m pretty sure this is a URL handler problem not a Python problem.) Is there a more reliable interface that can handle many updates without starting to fail? - Are there any interfaces at all to update metadata or apply actions to existing drafts based on UUID? I thought there were, but on closer inspection I’m not seeing obvious methods in the URL scheme, and the relevant Shortcuts actions seem to assume that they’re hard-coded to point to an existing draft rather than being parameterized to take any draft (that might be loaded by UUID).
Thanks!