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


Click here to return to the 'AppleScript to open a collection of Safari tabs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
AppleScript to open a collection of Safari tabs
Authored by: musselrock on Apr 18, '11 09:11:43AM

I've used a script like this one for several years to do my daily reading. Here is how to open specific pages on specific days.

tell application "Safari"
launch
make new document
set bounds of window 1 to {20, 22, 1184, 1012}
end tell
set thisDate to current date
set thisDay to weekday of thisDate
if month of thisDate is in {December, January, February, March} then
openAsTab("file:///Users/diorite/Sites/SkiConditions.html")
end if
if thisDay is Monday then
openAsTab("http://www.myhistorycanbeatupyourpolitics.blogspot.com/")
end if
if thisDay is Tuesday then
openAsTab("http://www.tidbits.com/tb-issues/TidBITS-current.html")
end if
if thisDay is Thursday then
openAsTab("http://www.macosxtips.co.uk/")
end if
if thisDay is Saturday or thisDay is Sunday then
openAsTab("http://www.tuaw.com/")
openAsTab("http://www.macfixit.com/")
openAsTab("http://www.macintouch.com/")
end if
openAsTab("http://www.doonesbury.com/strip/dailydose/")
openAsTab("http://www.nytimes.com/")
openAsTab("http://www.nytimes.com/pages/opinion/index.html")
openAsTab("http://www.cnn.com/")
openAsTab("http://news.bbc.co.uk/")
openAsTab("http://www.macupdate.com/")
openAsTab("http://www.macosxhints.com/")
openAsTab("http://www.tuaw.com/")
openAsTab("http://www.macnn.com/")
tell application "Safari"
activate
end tell

on openAsTab(theURL)
delay 1
tell application "Safari"
make new tab at end of tabs of window 1 with properties {URL:theURL}
end tell
end openAsTab



[ Reply to This | # ]