I’m having an issue attempting to use a bookmarklet to append a markdown link when I press it. I have this working on iOS using Shortcuts which works great but I need something on macOS (until I get an M1?).
Here’s what happens:
- Go to page
- Click bookmarklet
- Confirm Allow
- No UUID found
This error is only in the bookmarklet. Pasting in the complete URL into Safari works and I can make it work via terminal as well. So there must be something with the bookmarklet code that isn’t right but I can’t for the life of me figure it out.
Here’s the code and website I am using:
From the Drafts capture docs: Bookmarklet Maker
s=document.getSelection();
if (s && s != "") {
s=`
> ${s}`;
}
t=`- [${document.title}](${location.href})`;
uuid='CC48F8DC-0271-438B-BC6C-269D4D67A8CF';
u=`drafts://x-callback-url/append?uuid=${encodeURIComponent(uuid)}&text${encodeURIComponent(t)}${encodeURIComponent(s)}`;
document.location=u;
Maybe this isn’t the right path either. Would like to know if there is a better option/way of doing this.