GUI Scripting Safari Tabs?

Hey everybody! Long time listener, first time caller.
Well, I’m trying to make a little app that will allow me to help me load a few sites I check everymorning in a single Safari window. I’d like to have each page load in it’s own tab, instead of it’s own window. Maybe I’m just tired but I can’t seem to figure out the menu commands for the Tabs. Usually I can find my answer with a quick search of the boards here but this one has me stumped, hence the first post. Thanks for any help!

Assuming you’ve got GUI scripting installed correctly and Safari is configured to use tabs, try this code:


Works awesome. Thanks a ton! :smiley:

Define an auto-tab group of sites in your bookmarks bar. Then use the following code (my auto-tab group is called “Mac Sites”):

tell application "Safari" to activate

tell application "System Events"
	tell application process "Safari"
		click menu item "New Window" of menu "File" of menu bar 1
		click button "Mac Sites" of last window
	end tell
end tell

That way, you can modify your list of bookmarks without modifying the applescript.