Hi, @DanThomas. Very nice subroutine; thanks for sharing!
Here's a simple example caller that converts a markdown link to an RTF web link.
Download: Set Clipboard String for Type Example - HTML-RTF (Link).kmmacros (5.2 KB)
I haven't seen a similar subroutine on the forum; however, with the macro Copy as Markdown Link by @ComplexPoint the link created has two variants/flavors: plain text and RTF.
What's really cool about Copy as Markdown Link is that when the created link is pasted in a text editor, it appears as plain text (i.e., [label](URL)
); otherwise as RTF (e.g., within a Comment action).
Dan, with my example caller I wanted to point out a subtle detail...
As uploaded when I ran the caller, I created the displayed link and then typed the remainder of the text.
Comment.kmactions (1.3 KB)
With the example caller, here's the HTML:
Without the
, here's what occurs when the link is pasted and the remaining text is typed.
Comment.kmactions (1.3 KB)
I've noticed the same issue when using Copy as Markdown Link and pasting into a Comment action.