Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > Is it possible for safari to launch a new browser

Is it possible for safari to launch a new browser
Thread Tools
Mac Enthusiast
Join Date: Sep 2003
Status: Offline
Reply With Quote
Oct 26, 2003, 01:11 AM
 
each time you click the icon in the dock? I guess i am used to ie in win2k, i expect it to launch a new browser each time, but it todesnt so i have to hit apple N.

Any way around this ?
| MBA Student | MacAddict | CarAddict | PhotoNut | Dork | PhishHead |
     
Senior User
Join Date: May 2001
Location: Massachusetts, USA
Status: Offline
Reply With Quote
Oct 26, 2003, 01:41 AM
 
Okay, you asked... here's one possible answer. It's not entirely perfect, but it's something:

First, open Script Editor and paste in the following AppleScript:
Code:
tell application "Finder" set safariRunning to process "Safari" exists tell application "Safari" to activate if safariRunning then tell application "Safari" make new document end tell end if end tell
(The reason for the if statement is that if Safari's not running, it automatically creates a new window when it starts up.)

Compile it, save it in "Application Bundle" format, name it something like " Safari " (with spaces; the script will get confused if it's named "Safari") and give it Safari's icon. Now, whenever you launch the script, its icon will bounce briefly in the Dock and be replaced by Safari's, at which point the script will quit. If you want, you can supress the script's Dock icon by navigating to Contents/Info.plist inside the script's bundle (use "Show Package Contents" in the contextual menu to get here) and adding the following lines to the Info.plist file:
Code:
<key>NSUIElement</key> <true/>
Now the icon won't show up in the Dock when the script launches. You'll still get two icons in your Dock, but only one of them will have an arrow underneath them, and that'll be the actual browser. It would be nice to be able to just click on Safari's icon and have the script activate, but if that's possible it's well beyond my knowledge of AppleScript. Maybe someone else knows how to do that. In the meantime though, this should tide you over.
     
Posting Junkie
Join Date: Sep 2001
Status: Offline
Reply With Quote
Oct 26, 2003, 01:47 AM
 
Launch a new browser everytime? It's just a new window, unlike Windoze, which actually opens the application all over again, right? Can't you run the same applications a few times if you wanted? Stick with Apple's desktop metaphor. Good ol' centralized menu has yet to fail me.

Never mind. I was confused. And now I'm going to bed.
     
Mac Elite
Join Date: Jul 2002
Status: Offline
Reply With Quote
Oct 26, 2003, 03:52 AM
 
If Safari doesn't have any opened (or minimized) windows, clicking on the dock icon will open a new window. However, if there is a window already open, clicking Safari's icon should bring it to the front. From there, you can open another window or, better yet, a new tab. I just keep a single window open, hide Safari when I'm not using it, and use Cmd-click to open links in a tab.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:09 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2