Copy email address then send email template to it

I’d like to be able to:

a) click on an email address on a webpage

or

b) highlight the address is it’s not clickable

Then for KM to send out an email with a template i’ve set when I interact with that email address in some way.

Please help!

Hey There,

What web page in what web browser?

-Chris

Thanks for the quick reply. Any webpage I come across, and in the Chrome browser.

You might take a look at this macro, and adapt it for your needs.

thanks - sorry for my ignorance, but what does ‘create markup for the link’ actually mean? When I hover over the link, what in plain English will happen?

It’s generally best to post questions about a macro in the topic of that macro.

It’s “markdown”, not “markup”. Markdown is a method to use plain text to indicate the formatting of the text.

You would modify the macro to just get the URL, and then use it to send your email.
Also, I’m not sure if it will detect an email address like it will a web address.

thanks for clarifying

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