Launching a new instance of something instead opening existing one?

Is it possible to have app launcher(Alfred or Spotlight) to launch a new instance of an app(Finder, Terminal) instead of taking me to existing instance?

I know this question: How to make clicking on icon in dock == open new instance addressed an issue for the Dock, but is there a way to achieve the same with app launchers?


Solution 1:

Windows of applications aren't normally called instances on OS X. You can open new instances with open -n, but there's no way to do that from the UI. Applications with multiple instances also have multiple Dock icons.

If you actually meant that, you could add an action for it in Alfred:

There's no standard way to open a new window with open or AppleScript though. You'd have to use different terminology for each application.

on alfred_script(q)
    tell application (q as text)
        activate
        if number of windows is 0 then
            reopen
        else
            if name is "TextEdit" then
                tell application "TextEdit" to make new document
            else if name is "Finder" then
                tell application "Finder" to make new Finder window
            else if name is "Safari" then
                tell application "Safari" to make new document at beginning with properties {URL:"about:blank"}
            end if
        end if
    end tell
end alfred_script