Create a Craft Note and Get Its Link

The Problem

Over the past few months, I’ve been using Craft as my primary note-taking app. It’s excellent overall, but one of its shortcomings is that when you create a new note using Shortcuts, it doesn’t return the link to that note. (In fact, Craft’s Shortcuts actions always open the app, even if you toggle off the Show When Run option, which should force it to run in the background.) I have several shortcuts that I use to generate notes, but then I want to use the link to the newly created note in a later step in the shortcut (e.g., adding a follow-up task to Things with the Craft link in the Notes field). It seemed like there had to be a way to accomplish this, but for several weeks I couldn’t find the answer.

The Solution

Enter Craft’s URL scheme. Thankfully, Shortcuts actions are not the only way to automate Craft. Its URL scheme provides complementary functionality, and it allows me to solve this problem. What I have done is constructed a subroutine that will accept a Craft URL, run the URL to create the note, process the information returned by Craft to recreate that note’s link, and then pass that link back to the main shortcut. It’s simpler than it sounds, and as long as the main shortcut passes a properly constructed Craft URL to this subroutine, it works well.

If you use Craft and have run into this problem, feel free to download my shortcut.