Open markdon urls

I created an action to open markdown urls in a draft - download from the action directory here

this action was build by inspiration form this entry in the drafts forum: I can’t seem to open a URL from a scrip
Credits to @RoyRogers - i stole some code from your examples and actions…
This action will search the current draft for markdown formatted urls - e.g. (I inserted a „]‘(„ between the brackets to prevent the description to display only the urls):

[Google]([www.google.com](http://www.gogle.com/)) this is famous search engine
text before [Bear](bear://) and text after
[text in brackets, no problem] [OneNote](onenote://open)
[Google]([www.gogle.com](http://www.gogle.com/))
[BBC](https://actions.getdrafts.com/a/www.bbc.co.uk)

It will search through the draft immediately open the url if only one url is inside the draft.
If there are several urls, a prompt with the URL titles as buttons will be displayed to select the url to open.
The urls are opened with safari, to enable „callback“ links (e.g. drafts://open…)

1 Like

Inspired by @FlohGro I updated my “Open All URLs” To be more flexible with a list of URLs to chose from. Also realized that open all links at once only works on Mac, so included button “Open All” on Mac only.

Please modify as you please :nerd_face:

https://actions.getdrafts.com/a/15m

1 Like

You can work around this if you are willing to utilise a call out to Shortcuts; which there is a Drafts action step for. If you create a list of URLS, pass that on to Shortcuts, and use an Open URLs action to open all of them at once.

This Shortcuts only example shows the basis.

1 Like

Thanks for posting this. I use Markdown reference links almost exclusively, so I took your script and added some code to handle that. Here it is. I also removed the Open All aspects of it (I don’t want to tempt myself into opening lots of tabs), so it’s not a truly replacement for your action.

Wow @drdrang I should have looked around a bit more on here, literally just made a post with the same goal as your action!

Yours is definitely more thorough than mine and more robust, I’ll definitely take a look to learn from it.

1 Like