The goal: take one very long text file and slice it into multiple drafts.
The stretch goal: have tags recognized and place each slice into a corresponding workspace.
I’m hoping someone can point me in the right direction here; I’m a Drafts rookie. I take all of my notes with pen and paper and transcribe them into text files for a given day. My hope is that Drafts can ingest them, separate them into individual entries in Drafts, and let me push them to their appropriate endpoints.
Send Alice an email regarding what to bring to the potluck. #email
Write a passage on managing screen time for a five-year-old. #blog
Had coffee with Pete: discussed how to sell an aging German muscle car. #day_one, #spending_time_with_friends
These all appear in a single text file. I want the first one to become an email draft, the second one to become another text file saved to a particular directory in Files.app, and the third to become an entry in a Day One journal named according to the last hashtag.
Thank you for the prompt reply @sylumer. The first place I went looking for some reading to do was the Drafts Scripting page only to find that the scripting reference dead ends at a GitHub 404. Any idea where the updated reference material lives (cc @agiletortoise)?
@sylumer I’m having trouble getting started with your recommendations. Specifically, I don’t know where to locate the draft object documentation. I’m starting my script attempt with just the simple act of splitting one long draft into pieces, with a delimiter of an empty line.
Thank you @sylumer, as always. While I’m attempting to learn how to integrate the JS syntax with the Drafts object syntax, I wonder if you (or anyone) has a good recommendation on best practices for developing JS-based actions within Drafts?
I honestly can’t recommend anything beyond naming things clearly (/understandably) and consistently.