I developed an alternative to using the Drafts app to quickly capture text and appending/prepending text files.
Why? When Drafts went to subscription, I had to take a look at how I used Drafts. The truth is, the development trajectory was heading towards an Evernote-style proprietary file system that I was trying to avoid by using Drafts. I just wanted to capture text, send it elsewhere. The very reason I bought the app in the first place.
To do this simple custom automation required the full subscription. I specifically did not want my notes collected in Drafts, which is where Drafts was headed. And exporting my Drafts was less than ideal, as they export into one long document. Had to get out of that silo.
The solution uses the 1Writer app to capture the text, and a 1Writer action to send it to Shortcuts. The Shortcut is set up to return the user to 1Writer once the text is processed, and I have a second 1Writer action to delete the text to clear it for the next capture. If I knew how to automate the text-clearing step, I would.
I have found this system to be better than how I used to do this in Drafts because I am forced to file the captured text immediately. Too often in Drafts I just āinboxedā everything.
Here is the JavaScript for the 1Writer action, which is set up as a custom key on the custom keyboard row:
var text = editor.getSelectedText();
if(text==""){
text=editor.getText();
}
app.openURL('shortcuts://run-shortcut?name=Sort&input=' + encodeURIComponent(text));
This sends the text to a Shortcut named āSortā, which of course should be edited to suit your setup.
Once sent to The āSortā Shortcut, that Shortcut allows me to choose from a set of different text append/prepend Shortcuts. So āSortā is just a menu that runs other Shortcuts.
Each of those Shortcuts do essentially the same thing, appending or prepending a text file in Dropbox or iCloud Drive. None of them are very complex.
These all have simple action steps like āGet Text From Inputā, then saved to a variable, then combine in a Text action to add a delimiter below the entry, then using Append To File to add to the text file on your desired cloud service.
Because much of this is used for daily logging, I implement a dynamic date stamp system for the titles of the files to be appended. This allows me to keep a daily log/journal and have the title be the current date, and be dynamically created.
My date stamp goes so far as to ensure post-midnight but pre-6am entries are made on the previous day (I am a night owl). Something I was unable to figure out in Drafts. But easily achieved in Shortcuts. I can share details if there is any interest.
The main key to all of this was being able to send text to Shortcuts. Other text editor apps besides 1Writer may have this capability.
I have a dedicated ācapture.txtā file in my 1Writer/nvALT folder that I use for capturing the text, and this file can be invoked by a Siri Shortcut, so you could even set up a home screen shortcut to pull up this exact capture.txt file for quick access.
Of course, you could just use the basic text capture window implemented natively by Shortcuts, but I find that tiny window excruciating to type into. With the 1Writer approach, I get a nice big canvas to work on, and access to all the text manipulation tools as I write.
As mentioned, I like this system better because it forces me to file the text snippet immediately.
I really do not miss Drafts at all, because most of the text editor automation/manipulation stuff I can do in 1Writer. And I now have the entire Shortcuts repertoire to work with when processing my text, so I feel like I have even more available to me by doing things this way.