Yesterday, I posted on MacStories about the Drafts 5.4 update (and the subsequent 5.4.1 release as well).
I cover the big topics:
Siri shortcuts: several actions are listed to customize and add to Siri which provide dictation possibilities that are improved over Shortcuts.app
WordPress publishing: customizable actions for posting to WordPress, with a site preview, and pulls in your categories and tags for selection.
Other Improvements: Separators are great for organization. I’m using it a lot to organize actions by area as well as by app. Dropbox API support is there and Google Drive has been added.
If you’re interested in the new stuff, giving this a read might be for you.
There are Siri shortcuts to open a specific draft, but not the most recent. There may be a way to pull in the most recent via scripting, but looking through the draft script object documentation, I don’t see an easy way.
//Function to compare draft objects by modified date and return them in reverse chronological order
function draft_marev_compare(a, b) {
const modatA = a.modifiedAt;
const modatB = b.modifiedAt
let modatComparison = 0;
if (modatA < modatB) {
modAtComparison = 1;
} else if (modatA > modatB) {
modAtComparison = -1;
}
return modAtComparison;
}
function lastModifiedDraft()
{
//Get all drafts
let arrAllDrafts = Draft.query("", "all", []);
//Sort all drafts by last modified date in reverse Chronological Order
arrAllDrafts.sort(draft_marev_compare);
//Return the UUID of the first draft object
return arrAllDrafts[0];
}
//Load the last modified draft
editor.load(lastModifiedDraft());
editor.activate();
Here’s the Shortcuts shortcut that will call the action in Drafts 5.
Here’s the actions in the shortcut. I put the action out as separate text to make it easier to maintain if you rename it as it needs to be URL encoded for it to be called via URL.