Post v4, Drafts uses iCloud for sync and so can’t auto-sync to files in Dropbox.
You can create actions that would let you read in a file from Dropbox and save back to it. This would be manually triggered. That refers back to the details in the post you linked to above.
I wrote a couple of actions to semi-automate the process of moving drafts to and from Dropbox:
It’s flexible in that it lets you save the draft anywhere in Dropbox, but it’s limiting in that you have to include the path to the file somewhere in the draft.
If you always keep a single draft per file, you could consider moving the path out into an index (e.g. as a JSON file) where you could match a draft UUID and a file path. If it isn’t a persistent 1-2-1 match, you would probably also need to include an initial existence in index & drafts/ Dropbox check, and overwrite the index value if necessary.
More complicated to maintain, but does keep your files clean, which can be an issue if they are config files, or if there’s a variation in the formats, gets around the approach that’s commonly used of putting the path on the first line which then makes it the title, etc.
Thank you, sylumer, for the possibility of not needing to have the Dropbox path in the file.
I have dozens of text files on Dropbox that I would like to be able to sync with Dropbox in the manner you’re describing. Can you give an outline of what’s involved or point to a set of scripts or actions?
Blessings, and thank you!,
Richard Fairbanks
I’ve just started with Drafts, so if this has been answered elsewhere - sorry !
The “Save to Dropbox” action script is OK, but I’d like to get the Workspace and the tags as well as the content. Is that possible?
Then (there’s always more, isn’t there?) I’d like to be able to select all the notes, preferably sequentially and back them up to a DropBox folder I’ve created. I’d run that via an IOS shortcut, and then overnight the server would combine the notes into a single JSON blob. The server side is trivial, I just need to get the right data into DropBox first.
Is anyone able to point me at some documentation to help?
The server-side process is as much me being comfortable with that approach as anything else. I’d get a JSON blob with individual notes any of which could be extracted if required. I’ll use the calls that you’ve mentioned though. Getting used to a sophisticated product takes time, and part of it is using the abilities that it provides without circumventing them.