Skip to content

Instantly share code, notes, and snippets.

@lonbaker
Created December 19, 2016 03:21
Show Gist options
  • Save lonbaker/13cb1ba6802c0590e863e57b594802cc to your computer and use it in GitHub Desktop.
Save lonbaker/13cb1ba6802c0590e863e57b594802cc to your computer and use it in GitHub Desktop.
set theURLs to {}
set Urls to paragraphs of (read POSIX file "/Users/lonbaker/Desktop/Urls.txt")
repeat with nextLine in Urls
if length of nextLine is greater than 0 then
copy nextLine to the end of theURLs
end if
end repeat
-- add URLs to reading list
my addToReadingList(theURLs)
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment