Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Add URLs to Reading List automatically from e-mails Internet
This is an update to this hint, Automatically add links from Emails, Twitter or Google Reader to Reading List . I found the solution posted there to be insufficient. The script only allows URLs to be on their own full line, whereas my solution scans the entire message for links everywhere. As long as they are separated by a space the script should find them. WebKit users can even set their own browser.

I hope this helps replace some "read later services" by Reading List.

Save the script below to ~/Library/Application Scripts/com.apple.mail/ and assign it to a new Mail rule.

An easier way to send yourself links is by adding +reading to your mail address. If your normal address is myaddress@gmail.com, it would become: myaddress+reading@gmail.com.

The beauty of this is that you can add this address to your Contacts and give it a nice name like “Add to Reading List”. The previous hint required editing e-mail subject lines in a predefined way. Apps like Reeder are able to send to a default mail address. With this, set the +reading address to be your default address, share via e-mail, tap Send, and it's done.

Set up a new rule with the following options:

  • Rule: “any recipient contains ‘+reading’”
  • Actions:
    • “mark as read”
    • “execute AppleScript” (this script)
    • “delete message"
    • “stop evaluating rules”

Here’s the script (you can also get it on GitHub):

(*
Add to Reading List

Script for Apple Mail to find http and https links in emails and add them to Safari's Reading List automatically.

Best practice: setup with "any recipient contains '+reading'". 
Actions "mark as read", "execute AppleScript", "delete message", "stop evaluating rules"

Created by Andreas Zeitler on 2012-10-07
*)

using terms from application "Mail"

    set theURLs to {}

    on perform mail action with messages theMessages

        try
            set theMessageCount to count of theMessages
            repeat with theMessageIndex from 1 to theMessageCount
                set theMessageContent to content of (item theMessageIndex of theMessages)

                -- find URLs in messages
                set cmd to "echo \"" & theMessageContent & "\" | egrep -o -e 'http[s]?://\\S+' | sed 's/[<>]//'"
                set theURLs to do shell script cmd

                -- make URLs a list
                set theURLs to paragraphs of theURLs

                -- add URLs to reading list
                my addToReadingList(theURLs)

            end repeat
        end try

    end perform mail action with messages
end using terms from

on addToReadingList(theURLs)

    -- set your preferred browser. Use "Safari" or "WebKit"
    set myBrowser to “Safari”

    using terms from application "Safari"
        tell application myBrowser
            repeat with theUrl in theURLs
                add reading list item theUrl as string
            end repeat
        end tell
    end using terms from
end addToReadingList
    •    
  • Currently 4.67 / 5
  You rated: 5 / 5 (6 votes cast)
 
[6,045 views]  

Add URLs to Reading List automatically from e-mails | 0 comments | Create New Account
Click here to return to the 'Add URLs to Reading List automatically from e-mails' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.