css

Q: how to force safari to open a new window when dock icon is clicked

If Safari is already running on my MacBook Yosemite, and I click on the Safari icon in the dock, the Safari window is brought forward.  The behavior  I want is whenever I click the safari icon on the dock, is that a new safari browser window is opened.  I don't see this option in preferences (or any keyboard  mouse combination) that would make the dock icon open a new browser window.    (an option is available for new windows if you click on a hyperlink, but not if you click on the dock icon) .

 

p.s. And I don't want to first  have to place focus on the current running safari and then click File New...too many steps when all I want is a new browser window

 

Thanks in advance

MacBook Pro with Retina display, OS X Yosemite (10.10.1)

Posted on Jan 15, 2015 10:38 AM

Close

Q: how to force safari to open a new window when dock icon is clicked

  • All replies
  • Helpful answers

  • by joe_7399,

    joe_7399 joe_7399 Jan 17, 2015 9:29 AM in response to css
    Community Specialists
    Jan 17, 2015 9:29 AM in response to css

    Hi css,

     

    Welcome to the Apple Support Communities!

     

    I understand that you would like to click on Safari in your Dock and have it open a new Safari Window. As you said in your post, clicking on Safari in the Dock brings the Safari window forward. There are a couple of possibilities to help resolve this situation. You can control-click (right click if enabled) on Safari in your Dock which will give you the option to open a new window. You can also click and hold on Safari, otherwise known as Press, to display these same options.

     

    Mac OS X: Additional features of the Dock - Apple Support

    Mouse clicks and key combinations for the Dock

    • Control-click
      Reveals contextual menu for item. Menu choices vary per application or file. When used on Dock separator, it reveals Dock preferences. There you can turn magnification and hiding on or off, change the position of the Dock on screen, and change the minimization effect. Choose Dock Preferences to see more options.
    • Press
      Reveals contextual menu for item. Menu choices vary per application or file.

     

     

    Cheers,

    Joe

  • by caduellery,

    caduellery caduellery Nov 1, 2015 5:01 PM in response to css
    Level 1 (0 points)
    Nov 1, 2015 5:01 PM in response to css

    You can't use the Safari icon to directly open a new window (unless you right-click etc, which is boring), but you can create an Apple Script that always opens a new Safari window, assign a fancy icon to this script and place it on the Dock beside the Safari icon. This way you can always choose between the focus on already opened windows (clicking on Safari icon) or create a new window (clicking on the "New Safari Window" icon). Let's do it.

     

    Open Apple Script Editor, make a new document and paste this code:

     

    tell application "Safari"

      make new document

      activate

    end tell

     

    Go to File menu, then Export...

    Give a name like "Safari - New Window", set a place to save like the "Applications" folder, choose "Application" for File Format and then check Run-Only. Save it.

     

    With Finder, open the location where you just saved this new app. Right-click (or Ctrl+click) the application and go to Get Info menu. Now, download this icon, drag it onto the little "Apple Script" icon on the top left corner of the "Get Info" window already opened to assign the new icon to your app.

     

    Finally, drag the application "Safari - New Window" to the Dock and drop it beside Safari. \o/

  • by Kazibole,

    Kazibole Kazibole Dec 6, 2015 1:11 PM in response to caduellery
    Level 1 (0 points)
    Dec 6, 2015 1:11 PM in response to caduellery

    Wow, great solution!

  • by LemonAndLavender,

    LemonAndLavender LemonAndLavender Sep 5, 2016 1:32 PM in response to caduellery
    Level 1 (4 points)
    Sep 5, 2016 1:32 PM in response to caduellery

    Thank you!  Helped out immensely. 

    A tiny tweak for instructions - I needed to save the file kind as "Application" instead of the auto-selected "script" - smooth sailing after that!