TIP: Convert all plain URLs to Markdown links with page titles

I usually share (sometimes copy-paste) links to drafts from multiple sources (eg. youtube app) then i push those snippets to Obsidian (Daily note under ## Links of the day section).

But finding just plain links after couple hours was annoying; either I forgot which is which and have to check first to prepend needed context or thoughts then make it a markdown link to it’s easier to process to other md support apps.

So made this quick action script, that goes over any plain url in the note, check the url, parse the response and replace it with proper markdown link [page title](url).

If anyone finds it useful, here it is:

(Feel free to make a better version, i just hacked it quickly)

Side note @agiletortoise, it’ll be nice if we could select an action to be triggered automatically from the share sheet somehow - or via special tags. Contributing positively to our laziness :laughing:

1 Like

You could add the link via a shortcut and then run the action on the same draft - that will not be covered in Drafts own Share extension but you can use the shortcut to share new links to the draft.

1 Like

Didn’t know I could also trigger actions in background with shortcuts! Thanks!!

Making multiple Drafts shortcuts group and mapping it to the useless iphone new side-button. Finally found a good usecase for it. :joy:

1 Like