public
Created

Automator Service - Add to Reading List - lax version

  • Download Gist
add2readinglist.scpt
AppleScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
--
-- Automator Service - Add to Reading List - lax version
--
-- http://warmfuzzyapps.com/2011/07/add-to-reading-list-lax-version/
-- Wiley Wimberly <wiley@warmfuzzyapps.com>
--
-- The default service that adds links to Safari's Reading List is a
-- bit on the strict side when deciding what constitutes a URL and it
-- doesn't work well for adding shortened URLs from apps like twitter.
-- This version is more tolerant and will prepend http:// if the
-- selected text does not already start with http:// or https://.
--
-- Service receives selected text in any application.
 
on run {input, parameters}
 
set theItem to item 1 of input
 
if theItem starts with "http://" or theItem starts with "https://" then
set theUrl to theItem
else
set theUrl to "http://" & theItem
end if
 
tell application "Safari"
add reading list item theUrl
end tell
 
return theUrl
 
end run

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.