Finding a Link

Oops, stuck again... Hours hunting the web...

I have an email which contains a URL link. How can I use Keyboard Maestro to locate and select (click on with mouse I think) that link?

How consistent is the link display? You might be able to get away with "Image detect and click" on the "http" part of the link... Otherwise you might be reduced to programmatically extracting the email body and parsing for links -- what's the mail client?

I do have to put my "Do you really want to do this?" hat on -- we spend a lot of time trying to train users to not "automatically" click email links but to mouse-over and visually check first. Obviously not so important if you're processing emails of known provenance that you can trust.

Ah so... First, yes the email comes from trusted sources. Second, it doesn't arrive as an Http link, but rather as a link embedded in text. Something like this:

Now is the time for all good men...

With the word "time" in color and underlined pointing to a link. Of course the text is usually quite a bit longer.

These messages are from trusted friends, forwarded after they have already opened the link and confirmed validity.

1 Like

Ah, the "joys" of modern email. Life was so much simpler when you actually typed out the link: <https://www.example.com> you wanted people to click...

If the only consistent feature is the underlining you might be able to run image detection on that, using a small image of the underline and "Leftmost" in the action's settings. You'll have trouble with multiple links in an email, though.

Otherwise you're probably back to parsing the email's actual content (rather than what's displayed), extracting the link(s), and either opening a single link or displaying a pick-list for multiple. How you do that will very much depend on your email client.

1 Like

LOL... While it is normally probably not worth the effort, I'm going to press on as a learning experience.

Thanx for your input... You can wish me luck!