Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Twitter favs to Safari Read Later through ifttt
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Twitter favs to Safari Read Later through ifttt



IFTTT re-enabled their Twitter recipes, so I combined the script contributed by poster "Eraserhead" at MacRumors (http://forums.macrumors.com/showthread.php?t=185036) with the solution previously created at The Apple Schism (http://blog.no-panic.at/2011/07/25/the-apple-schism/) to re-deploy the routine for adding Tweets marked by you as Favorites to your Read Later list in Safari. It's possible to limit the action to only the first URL located in the automatically generated email, of course. There's an extra line to uncomment so you can run without the "using terms" construct for testing. If you'd like to contribute a more robust version, please do. Thanks.


--AppleScript--

using terms from application "Mail"

on perform mail action with messages theSelectedMessages

tell application "Mail"

--set theSelectedMessages to get selection

repeat with eachMessage in theSelectedMessages

set theurls to content of eachMessage

set thelist to {}

repeat

set startofurl to the offset of "http" in theurls

if startofurl is 0 then exit repeat

set count1 to startofurl --this counts the position in theurls string

set theURL4list to "" --this stores the URL as it is being recovered from the text

repeat

set theitem to item count1 of theurls --gets an individual character from theurls

if theitem is in {" ", ASCII character 10} then

set thelist to thelist & theURL4list --adds the url to the list

exit repeat

else

set theURL4list to theURL4list & theitem

end if

set count1 to count1 + 1

end repeat

set theurls to items count1 thru -1 of theurls as string

end repeat

repeat with aURL in thelist

tell application "Safari"

add reading list item aURL

end tell

end repeat

end repeat

end tell

end perform mail action with messages

end using terms from

--Un-AppleScript--




Laine Lee

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.