Open Mail URI Snippet

Hi @dmrogers99, welcome to the forum.

The trouble is that the extension is URL encoding the the selected text, then prepending message:// to it — but the selected text itself is already a properly formed URL. Essentially is is encoding the message URL in another message URL.

What we want to do is open the selected text directly as a URL, without any additional encoding. The easiest way is with a JavaScript snippet line this:

#popclip custom URL scheme Apple Mail
name: Mail URL
icon: symbol:envelope
javascript: popclip.openUrl(popclip.input.text)

As an aside though, effectively what we have made here is an extension that opens ANY text as a URL.
(Though you could add a regex to make it only appear of the text contains message://)

Another way to accomplish this is to tell PopClip that it can treat message: URLS as openable with the Open Link action. I’ve added this to PopClip’s code (it has a hard coded list) for the next version. And you can configure it with the following terminal command:

defaults write com.pilotmoon.popclip OtherURLSchemes -array-add message

then Quit and restart PopClip

1 Like