Metadata/links for drafts

Hi is there anyway to make it so that drafts will capture the link/source of where information is clipped/saved from? I’ve been using drafts keyboard shortcuts on mac, iOS sharing to drafts, and Popclip on mac to clip/save things that I find on the internet and none of them seem to save the link/source of where I clipped or added it from. This makes it a bit more difficult to manage some things- for example, if i clip a helpful tip from this forum, it would be helpful if I could easily find all the tips that I clipped from this forum without needing to individually tag each by just searching my drafts app for the forum url (or the word ‘drafts’). Is there any way to make Drafts remember the website link that I clipped from? Thanks!

1 Like

Hi, I’m guessing that this is not possible now? Or is it?

If not, is this kind of functionality in the plans for the future?

On IOS, you should be able to use Shortcuts to receive the additional info (URL) from Safari and then pass that into an action step for operating on a Draft.

See the Get Details of Safari Web Page action and the various Drafts actions in Shortcuts.

On the Mac, if you have access to say Keyboard Maestro, you could rig up an action that would grab the selected text (or clipboard) and combine it with the URL of the page; then combine that and pass it on to Drafts. Maybe via the clipboard, maybe via sharing. Not something I’ve specifically needed at this point so off the top of my head I can’t give a definite viable approach.

Hope that helps.

When using the Share Extension from Safari, you can set it up to capture the URL and Title of the page (Settings > Share Extension). The tricky part (and what confused me for a while) is that if you have some text selected on the page and want it to capture the page info, you can’t use the share button that pops up in the text selection menu, you have to use the regular Safari share button.

1 Like

That embarrassing moment when you realise that you already have it configured to capture a URL and overlooked it entirely.
:rofl:

I’m still interested in doing this on the desktop… I think that for now we may need to use the applescript features to homebrew it for now.

The Mac share extension works exactly the same way in Safari on the Mac. Relies on Safari integration, so does not work that way in other browsers.

It would certainly be possible to use AppleScript to create a more advanced version that could capture from other browsers as well.

1 Like

This chap here has figured out a way using launchbar: https://gist.github.com/gabeanzelini/1931128eb233b0da8f51a8d165b418fa

Here’s a script I’m currently firing from Alfred that seems to work so far. It’s ugly, I’m presently going to refactor it into JXA and see if that’s better.

if (count of theSelectionFromBrave()) is greater than 0 then
	set str to "tags: #link" & linefeed & linefeed & theTitleFromBrave() & linefeed & linefeed & "> " & theSelectionFromBrave() & linefeed & linefeed & theCurrentUrlInBrave()
    
	tell application "Drafts"
		make new draft with properties {content: str}
	end tell
end if


on theCurrentUrlInBrave()
	tell application "Brave Browser" to get the URL of the active tab in the first window
end theCurrentUrlInBrave

on theSelectionFromBrave()
	tell application "Brave Browser" to execute front window's active tab javascript "getSelection().toString();"
end theSelectionFromBrave

on theTitleFromBrave()
	tell application "Brave Browser" to get the title of the active tab in the first window
end theTitleFromBrave