Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Iceman332k1

macrumors newbie
Original poster
Dec 15, 2009
9
0
I need to make an Applescript that opens Safari (or switches to it if it's already open) and then opens a webpage. Just something basic like www.hulu.com or www.gmail.com. I want to bind it to a tap on my new magic mouse, but for the life of me I am unable to find a script online that I can get to work. Again, I do not need it to do anything after opening the webpage.

Thanks
 
Confused

I'm sorry, but could you type it out as it should read as an applet? I'm honestly having trouble and this is my first attempt at applescripts
 
Open AppleScript Utility (It's somewhere in the Applications folder I believe).

Type the previous code with hulu.com replaced with whatever URL you want to go to.

Save it as an Application.

Now you have an Application.

Double click the application to go to the URL.
 
Reply

If you don't want it to always open in safari, you can just remove the "tell application safari part"
Make sure the browser you want to open it in is your default browser. Then in AppleScript, type:
Code:
open location "www.google.com"
You can change the url to whatever you want.
Then press "command shift s" to save as and select application. Now when you open the app, the url will open.
Hope this helps!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.