0

So I'm using BetterTouchTool to set up shortcuts, and I have a bunch that are dedicated to opening various apps. The problem is, if one of those apps are already open, then hitting the shortcut pulls that instance into focus, rather than spawning a new one.

This is especially annoying since I use multiple desktops heavily-- If I'm on desktop 6 and want to spawn a terminal window, but one is already open on desktop 1, then it moves me back to desktop 1 rather than creating a new terminal instance. I'm used to working on Ubuntu, where I have many terminals open across my virtual desktop.

I do realize that questions to this effect have been asked before, but I'm looking for a general solution that could apply to, say, Chrome, just as well as Terminal. On second thought, I don't need a truly general solution; I only need this to work for Terminal and Chrome.

I'll stress that this question is asking how to achieve this with keyboard shortcuts, rather than solutions that involve any mouse actions on the Dock.

1 Answer 1

1

you can open a file from the terminal by using the open command. For example to open the Atom editor you could type open -a /Applications/Atom.app/Contents/MacOS/atom. To open another instance of the app, use the -n option with open. For example, to open another instance of Atom type: open -n -a /Applications/Atom.app/Contents/MacOS/atom.

I suppose a script could be written to execute this and then a keyboard shortcut for the script could be set.

2
  • good idea, let me try that Commented Oct 10, 2019 at 0:29
  • So this worked perfectly for Chrome. For iTerm2, it spawned an entire new instance of the application, rather than a new window (Chrome knew how to handle this, and kept all opened windows associated with one global instance of the app itself). So, for iTerm, I had to get more involved, where on the shortcut trigger, a script is run which first checks to see if iTerm is already running-- if not, spawn a new instance, and if so, send a new-window shortcut to iTerm (this works even if there is no iTerm window open in the current space). Also had to use a apple script for Finder. Twas fun. Commented Oct 23, 2019 at 9:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .