Applescript to open hyperlink from email into web browser - current code doesn't locate hyperlinks, only direct URLs

I'm curious how I can write an Applescript to comb an email to open a link in Safari.

I have an Automator Service that locates all links in a given email and outputs them to a TextEdit document but since the link in the email is a link to a webpage and not a defined URL it doesn't pick it up on its sweep.

Some characteristics that may be of some help:

  • The link is always the same (minus the date portion) "SearchID_3251_[dateinfo].xls"
  • The link is always the last line of the email.

Does anyone know of a way to have Applescript comb an email, and if it finds the correct string "SearchID_" to copy the URL behind the link and then open it in Chrome or Safari?

Here is the Applescript that combs the email:

 on run {input, parameters}     set mailContentList to {}     tell application "Mail"         repeat with selectedMail in input             set end of mailContentList to content of selectedMail         end repeat     end tell     return mailContentList end run 

I then use an Extract URLs from Text in Automator and push to a New TextEdit Document, but again, it isn't picking up the link.


Category: applescript Time: 2016-07-28 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.103 (s). 12 q(s)