Help extracting links from Mail messages please.

Hi Everyone-

I am looking for the best route to extract http urls from mail I recieve. I get a lot of messages that have links to more article details, so I want to grab these links and pl;ace them in a printable list that I can later use with iSilox to transfer the articles to my Palm for reading.

Thanks in Advance.
SA
:smiley:

There are several existing bbs threads and a couple of websites where you can examine scripts for capturing the content of messages in mail.app.

Example:


set email_list to message id of every message
repeat with one_email in email_list
set mail_contents to (content of first message whose message id is one_email)
-- do whatever
end

Once you have the mail contents, there are several ways to parse them, depending on length. You can save the contents as text, then use a text editor with wild cards or GREP to extract the text between the anchor tags; call a shell script that uses GREP to extract the text, or write an applescript handler to extract the text. It’s not that complicated. Search for the anchor tags, then once one is found, get the value of the href attribute.