AppleScript to open a collection of Safari tabs
Here's a simple AppleScript that replaces the current Safari window with a collection of tabs, each open to a different URL. I've seen several scripts that attempt to do something similar, but this one improves on them in a couple of ways:
- It closes all of the old tabs, rather than just adding new ones.
- It opens the new tabs directly in AppleScript, which is much faster than using system events.
tell application "Safari" activate -- close all but one tab of the front window try repeat close tab 2 of window 1 end repeat end try -- open the URLs in separate tabs tell window 1 set URL of tab 1 to "http://weather.yahoo.com/forecast/USMD0100.html" ma ...
Source: http://feeds.macosxhints.com/click.phdo?i=71d6b65e02d5814f1a0b37d4d3a5761c