open a new window on application launch

Discussion in 'macOS' started by urmajest, Nov 27, 2007.

  1. urmajest macrumors newbie

    Nov 27, 2007

    For example, (when Safari or Terminal application is already launched)
    pressing the dock icon or launching from quicksilver brings the window
    to the front (or moves to a specific space where the window is in).

    Is it possible to modify this behavior to opening a new window? By clicking
    the dock icon (or some sequence of keyboard shortcuts) I want to open
    a new window of safari or terminal. Furthermore, it would be great if
    this can be done to the current 'space'.

    Is there a simple way of doing this?
  2. vanmacguy macrumors 6502a

    Aug 13, 2007
    Not where you live.
    Yes, there is an extremely simple way of doing this. Just press CMD N. And a new window will open for you. This works in all kinds of applications, but specifically in the two you mentioned.

  3. ab2650 macrumors 6502a

    Jun 21, 2007
    I agree. Plus, "second clicking" the dock would work differently for different apps... Why would you need a second iTunes window?

    If you're really committed to it, I bet you could write an automator action (and put it in your dock) that would open an app and another window whenever it was run. Maybe?
  4. urmajest thread starter macrumors newbie

    Nov 27, 2007
    No. Suppose that there's an open Terminal window in Space 1. I'm working
    on Space 2 and suddenly I needed to open a Terminal window in the current space (i.e., Space 2) If I click the terminal icon on the dock, what happens? Leopard moves to Space 1 and focus on the currently open terminal. Then, I need to press cmd+n and move the newly opened window to Space 2. That's too much work for me :)

    I actually prefer to have a shortcut which opens a new Terminal window in the current space.
  5. weizilla macrumors regular

    Feb 7, 2008
    has anyone figured out how to do this? I would like to be able to do this too as I have been using Linux for a few months and it's really easy to launch terminal window.
  6. dsnort macrumors 68000


    Jan 28, 2006
    In persona non grata
    Have you tried to create a new keyboard shortcut in System Preferences? I not sure you can do exactly what you want, but I know you can tie a keyboard shortcut to a specific application.
  7. rossmcf macrumors newbie

    Dec 5, 2008
    I think this is a solution…

    Ok, so you don't want to be pulled away to the app in another space just so you can launch a new window in the current space. I think that's it.

    Here's what worked for me:

    In the Spaces Preference Pane, disable the "When switching to an application…" option. This will prevent you from flicking back to the open window when you ⌘-Tab to the app you want a new window for.

    So now, if you've got an open Safari window on Space 1, and you're on Space 2, ⌘-Tab to Safari and ⌘-n for a new window in Space 2.

  8. caspin macrumors newbie


    Feb 25, 2009
    Same sort of problem

    OK, I run up an application in Space 1 and then switch to Space 2. I then right-click on the Dock icon and open a new window in the application and that window is created in Space 1 where the original window was created. I disabled "When switching to an application..." in Spaces System Preferences and the same thing happens. I had already disabled the plist parameter to stop the auto-switch to a different space using the command:

    defaults write workspaces-auto-swoosh -bool NO

    That works but the new window is still created in the same workspace as the one in which the original window was created.

    Funny thing is, this only happens on my Mac Pro desktop, on my Macbook Pro thew new window is created in the current space. I think this problem started happening when I did a recent system update, not 100% sure though.
  9. rossmcf macrumors newbie

    Dec 5, 2008

    I've just double-checked with Textmate and Safari. In both cases, creating a new window or file (Cmd-N) or using the dock icon produces the new window in the current space, not where the previous window lives.

    Good luck in finding a solution…
  10. Gerrit Griebel macrumors newbie

    Sep 12, 2009
    using butler to achive this

    I use butler smartitems to connect a keystroke to a snipplet of applescript to start a new firefox window on current space:

    tell application "System Events"
    tell application "Firefox"
    end tell
    keystroke "n" using {command down}
    end tell
    end try

    or to create a new terminal with a session on a remote host:

    tell application "Terminal"
    do script with command "ssh -X some-host-name; exit"
    end tell
    end try

Share This Page