ksalzke / open-url-from-note-omnifocus-plugin

8 stars 2 forks source link

Can't open links with Markdown formatting #5

Open JoelAnderson-UU opened 1 year ago

JoelAnderson-UU commented 1 year ago

Hi Kaitlin! I just joined your Supercharge OmniFocus (beta) course. Looking forward to this! I created a task in OmniFocus with a link to a the web page for the course. As I always do, however, I made this a Markdown link so that the description is readable, like this:

[Using Omni Automation on macOS | Kaitlin Salzke](https://kaitlinsalzke.teachable.com/courses/supercharge-omnifocus/lectures/43859410)

Screenshot 2023-01-22 at 13 00 23

If I run the "Open URL from Note" plugin, however, I get an error message:

The application can't be opened. -50

What does work is: the bare URL or a hyperlink in RTF.

Is there anything that can be done to make Markdown links readable for this autonmation?

Thanks!

ksalzke commented 1 year ago

Hi @JoelAnderson-UU

I would need to have a look at the regex to see if there's a way I can make this work (I'm sure there's a way but it might take me a while to get to/work out). The challenge right now is that parentheses can be valid in URLs, so it's picking up the URL as Salzke](https://kaitlinsalzke.teachable.com/courses/supercharge-omnifocus/lectures/43859410) - obviously that isn't going to work!

What does seem to work in my limited testing is if you leave the link on its own i.e. if you use

[Using Omni Automation on macOS | Kaitlin Salzke]( https://kaitlinsalzke.teachable.com/courses/supercharge-omnifocus/lectures/43859410 )

Is that something that might be an option? I think it maintains the readability aspect, but it may break other workflows if you're using this for something else?

JoelAnderson-UU commented 1 year ago

That's a very clever workaround! And it seems to work for me too. What I'll do is create a Keyboard Maestro macro for pasting a markdown link into an OmniFocus item, adding the spaces in the process.

JoelAnderson-UU commented 2 months ago

After bringing this up on a OmniFocus Webinar that David Sparks ("MacSparky") hosted, it occurs to me that the Automation Plug-in "Replace Markdown Links" would take care of this.