Invalid URL error using variable crafted to append text to Drafts draft

Newbie here, trying to write macro to prepend a Drafts (Mac app) note with copied text from web page. I'm encountering some issues with copying (still troubleshooting) but the main error, I believe, is coming from an attempt to build a URL using system clipboard in Set Variable action, and then using that variable in the Open URL action. I'm receiving the error: 'Open URL failed with invalid URL'

Screen Shot 2020-11-04 at 8.51.51 PM

I figured I'd find existing macros that interact with Drafts to study, but haven't been able to find anything. Any guidance would be appreciated!


The URL needs to be a valid URL (as defined by the OSX System API for NSURL, which is very strict in its requirements).

That means the field must be properly encoded.

Fortunately, the Filter action has a filter explicitly for Percent Encoding for UTR. So after the Copy, use the Filter action and percent encode the System Clipboard and store that in a variable, and then use that resulting variable to create your URL.

Screen Shot 2020-11-05 at 5.47.16 PM

Thanks, Peter. That was helpful and I was able to achieve my goal... temporarily.

I continue to have trouble with the macro terminating due to the Copy action timing out. I'm copying from a web page after highlighting text. I've tried the alternatives (using menu command, keystroke), and have tried disabling my clipboard manager, Copied, but to no avail. I have had trouble identifying a solution in the forums so I feel like I'm missing something simple!

Your advice is very much appreciated.