Extract separate subject and URL from selected apple mail email markdown link

Hello, I am working on sending the subject and URL of the currently selected email in apple mail to an app called Anybox (basically an excellent link manager).

Using @ComplexPoint 's excellent "copy as markdown link "macro Copy as Markdown Link - #89 by ronald I am able to get the markdown link of the currently selected email in apple mail.


[OSXDaily: Fix “Gmail is having authentication problems. Some features may not work.” Error and more for 2023-11-21 2023-11-22 05:39 OSXDaily <contact@osxdaily.com>](message://%3Ca3b1caf44f4736ea69e25894eb5d131d@mlsend.com%3E)

from which I basically want to extract:
1- the URL

2- the subject
basically everything else (everything minus the URL in parenthesis and minus the brackets around the subject).

thank you very much

Assuming that everything you want to process follows the format of the example you give (URL contained in parenthesis and subject in square brackets) then this regex will extract what you want:


Here's an exmaple of using it against your example text in KM's Search using Regular Expression Action:

1 Like

thanks very much. I tried to apply your solution to the clipboard but am stuck at the variable field. How do you use multiple variables ?
thanks again

Use the action "Search using Regular Expression", not "Search and Replace".

1 Like

fantastic ! works perfectly, and I discovered a very useful action thanks to you. thank you very much !

1 Like