For most apps you can simply open multiple windows or tabs to edit or view separate documents. But some apps only let you have one window open. Sometimes when using apps like Safari, it is useful to be able to isolate windows from each other in case one crashes. Learn how to use the Terminal window to launch multiple instances of the same app. Learn how to then use Automator to create an app that will do this for you automatically.
Hi this is Gary with MacMost Now. On today’s episode let’s look at how to run multiple instances on an App on your Mac.
In most cases you don’t need to have multiple copies of an App running. For instance in TextEdit you can have several documents open in different windows. The same as in Pages and Numbers and other applications that have documents. In cases like Safari for instance you can have multiple windows open looking at multiple websites. You can even have multiple tabs open in those windows. So you never really need to have more than one copy of Safari or Browser running.
One reason you may want to have an App running multiple times is if you are only allowed to open one window in it. For instance in the Calculator app. Another reason is if sometimes the app crashes. For instance since Safari is a web browser and can access all the sites in the internet and not all the sites in the internet are put together that well sometimes you run into one that will crash your browser particularly if it has a lot of media on it say some videos or games or something. You may notice that it crashes every once in a while when you go to that website. So you want to run a separate copy of Safari when you are viewing that website so that your other windows in Safari that are open won’t crash with it.
So say we wanted to run Calculator. You can run it in many different ways. But let’s go to the Applications folder here and in the Applications folder we can double click on Calculator and it runs. Now we have this one calculator window. Sometimes it would be nice to have a second one. So how can we do that?
Well an alternative way to launch an app is to use the Terminal window. So you launch Terminal. You can find that in your Applications folder as well. So let’s quit Calculator here and let’s instead run it using the Terminal. You do that using the Open command. So open, and then we have to give the full path to the application. So it will be /Applications/Calculator.app
So I do that and it will actually run Calculator. The same thing as double clicking on it in the Finder.
So let’s quit the Calculator and go down here again. There is an alternative option for this command -n, which means run a new instance of. We can do the same thing here /Applications/Calculator.app and it will behave the same way. Now the difference is that if we switch back here to the Terminal window and we type that again, and the shortcut for doing that by the way is up arrow, will repeat the last command there on the line and then I can just do up arrow and return rather than typing all those characters, it will actually launch a second version of Calculator. I actually have two of them running. It shows me two in my Dock and I have two different calculators running and I can use them both separately. So that is kind of handy there, especially with the calculator app.
You can do the same thing with Safari. That will launch Safari. Let’s shrink this window down here, a nice little Safari window, and I can go to macmost in that window and I can go back here and retype the command or use the up arrow and return and it will launch a second copy of Safari, you can see here, and I can go to another website in this one. The cool thing is that even though this looks like two separate windows running Safari I actually have two different instance of Safari so if I quit one or say it crashes for some reason I can very easily then just still have this second copy running.
Now if you would rather not do Terminal commands you can actually put this all together in Automator. I am going to run Automator here and it is a very simple Automator script. I am actually going to go here in Terminal and copy this command here where we open -n /Applications/Calculator.app, copy that, and in Automator I am going to create a new application and then I am going to add to this application here a shell script. I am just going to type shell here in the search and Run Shell Script and I’m going to drag and drop that on here and I’m going to paste in that command right there and now I am going to Save it. I can Save it anywhere I want. I am just going to Save it on the Desktop for now. So MultiCalc.app. I’m going to quit Automator. Now I’ve got here on my Desktop you can see this multicalc.app and I can put that in my Applications folder if I want. I can put it anywhere I want. Just double click it and it will run Calculator and if I double click it again it will run Calculator again. So I can use it very quickly without using the Terminal to create multiple copies of Calculator.
So I hope you found this useful. Until next time this is Gary with MacMost Now.