Jump to content
Sign in to follow this  
bren

make a program to open safari

Recommended Posts

I have a few websites I would like to open at the start up of my mac is there a way to do this with Automator.

Share this post


Link to post
Share on other sites

Probably, but here's how to do it in applescript. Paste this is and save it as an application, and optionally se it to start at login if you wish.

 

Put as many of these as you need, replace the url with the site you wish to open:

 

my new_tab()

set the URL of document 1 to "http://grahamgilbert.com"

 

tell application "Safari"
activate
set the URL of document 1 to "http://www.apple.com"
my new_tab()
set the URL of document 1 to "http://findth.at"
my new_tab()
set the URL of document 1 to "http://grahamgilbert.com"
end tell
on new_tab()
tell application "Safari" to activate
tell application "System Events"
	tell process "Safari"
		click menu item "New Tab" of menu "File" of menu bar 1
	end tell
end tell
end new_tab

Edited by Graham

Share this post


Link to post
Share on other sites

I have never used applescript before and I'm having trouble I don't under stand how to run or save it.

Share this post


Link to post
Share on other sites

Open up Script Editor (or AppleScript Editor if you're running Snow Leoprard), and paste the code in. Then you just save it as an application.

Share this post


Link to post
Share on other sites

File -> Save As -> File Format: Application.

Share this post


Link to post
Share on other sites

What are you pasting in to script editor? It's working fine here on my 10.6 install.

Share this post


Link to post
Share on other sites

When i ran a box popped up saying System Events got an error: Access for assistive devices is disabled. It also highlighted this line: click menu item "New Tab" of menu "File" of menu bar 1

Share this post


Link to post
Share on other sites

Ah. Go to system preferences and enable assistive devices in the universal access pane. I forgot about that, I always have it turned on.

Share this post


Link to post
Share on other sites

Bum, double post. Please delete this!

Edited by Graham

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing

    No registered users viewing this page.

  • Who's Online (See full list)

    There are no registered users currently online

×