Hey There,
JM's idea is very good for getting a specific link if it's available.
To get links without the Markdown you could play with the JavaScript in the macro, or more simply you could use this macro:
Then again – you could parse the source of the webpage for all available email addresses.
In this AppleScript I'm using the Satimage.osax AppleScript Extension. (It MUST be installed for the AppleScript to work.)
You can substitute Keyboard Maestro's RegEx search for the Satimage.osax, but I'm not going to bother.
-------------------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2015/05/14 15:27
# dMod: 2016/05/02 13:48
# Appl: Google Chrome
# Task: Extract Email Addresses from the Active Tab of the Front Window
# Libs: None
# Osax: Satimage.osax { http://tinyurl.com/dc3soh }
# Tags: @Applescript, @Script, @Google_Chrome, @Execute, @JavaScript, @Named, @Tab
-------------------------------------------------------------------------------------------
set javascriptStr to "document.body.parentNode.outerHTML"
tell application "Google Chrome"
tell active tab of front window to set pageSource to execute javascript javascriptStr
end tell
set foundEmailAddressList to fnd("\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}\\b", pageSource, true, true) of me
-------------------------------------------------------------------------------------------
--» HANDLERS
-------------------------------------------------------------------------------------------
on fnd(_find, _data, _all, strRslt)
try
find text _find in _data all occurrences _all string result strRslt with regexp without case sensitive
on error
return false
end try
end fnd
-------------------------------------------------------------------------------------------
It's also possible to do the search with JavaScript itself, but I still don't know how to do that. (Perhaps @ComplexPoint will jump in and demonstrate.)
-Chris