Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Launch multiple instances of any given application Apps

Although there have been previous hints on launching multiple instances of an application, most often they have revolved around manually duplicating the icon of that app. Technically, that is not launching multiple instances of an application but launching several identical but independent applications.

You can do it without cluttering your desktop. The hint is not mine, I found it in this old thread at the forums. Although it has been submitted several times in some comments, hints involving duplicating icons keep being published. So here is the definitive universal hint to launch multiple instances of an application. It requires Terminal use, but most probably it would be damn easy for a JavaScript coder to develop a dropplet that would perform the same by just dropping into it the icon for the desired app to be relaunched.

To launch a new instance of a Cocoa application, no matter if it is already open or not, simply open the Terminal and type:

/Path/To/Application.app/Contents/MacOS/Application &
For example:
/Applications/TextEdit.app/Contents/MacOS/TextEdit &
Type that as many times as instances of TextEdit you want running. The & lets you close the Terminal and keep working with the launched instances. Launching Carbon apps is not that easy. If the application is not a bundle, you do that by typing:
/System/Library/Frameworks/Carbon.framework/Versions/Current/
  Support/LaunchCFMApp '/Path/To/Application' &
Type the above as one line, and do not add a space between "Current/" and "Support." If it is a bundle, type:
/System/Library/Frameworks/Carbon.framework/Versions/
  Current/Support/LaunchCFMApp '/Path/To/Application.app/
  Contents/MacOS/Application' &
Again, type the above as one line with no spaces between the "/" at the end of each line and the text on the next. For example,
/System/Library/Frameworks/Carbon.framework/Versions/Current/
  Support/LaunchCFMApp '/Applications/StuffIt Expander.app/Contents/
  MacOS/StuffIt Expander' &

OK. This is not so universal. There are a few applications that refuse to launch. However, if this does not work with a certain application, most probably it will not work either with the 'duplicate icon' hint. For instance, do not bother trying to use this with Adobe Photoshop 7.0!

[robg adds: I have not tested this hint myself.]

    •    
  • Currently 3.50 / 5
  You rated: 4 / 5 (6 votes cast)
 
[39,726 views]  

Launch multiple instances of any given application | 9 comments | Create New Account
Click here to return to the 'Launch multiple instances of any given application' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Launch multiple instances of any given application
Authored by: coyote4til7 on Jul 15, '03 12:37:08PM

Hmmm... search OS X hints for the 'do shell script' syntax and stir fry:

on open theApps
repeat with anApp in theApps
myScript = anApp & " &"
do shell script myScript
end repeat
end open

Note: this should work, but I'm at my job in front of a (cough) XP box, so the script is untested. I'm looking forward to getting home and testing it. I see a new icon joining stuffit at the top of my Finder Windows...



[ Reply to This | # ]
Launch multiple instances of any given application
Authored by: etrepum on Jul 15, '03 02:15:31PM

Well you'll need a posix path, either in quotes or with escaped spaces. Otherwise, the applescript looks ok to me.



[ Reply to This | # ]
Works, but not Diablo 2
Authored by: sylvank on Jul 15, '03 06:22:21PM
This appears to work well, except for Diablo 2 (1.10) which is one of the only apps I can actually see a reason to run two copies of (so I can network two characters and trade gear etc.)

[ Reply to This | # ]
Launch multiple instances of any given application
Authored by: dmmorse on Jul 15, '03 07:24:14PM

I would be very careful launching two apps at the same time. I tried the following:

1) launch Safari normally;

2) with Safari running from step 1, launch Safari again, but this time sudo'ing using the above hint.

With Safari running in two instances, the sudo'd application picked up the preferences of the normally run application. This should not have happened, as the sudo'd application should have taken its preferences from the root preferences folder. It did not, so there must be some sharing or memory or resources going on that is not intended.

In short, I would not run multiple copies of the same application unless I have a recent backup of my important data. Of course, regular back-ups are always a good idea.



[ Reply to This | # ]
No problem here
Authored by: discordantus on Jul 16, '03 06:34:09PM
hmmmm... I did the same thing, and it used root's preferences, bookmarks, etc... Seems to work fine here.

I regularly use this trick to run an application as root, and have never had any problems with it. I've also used it frequently to get open multiple copies of programs that otherwise only allow one open window, or one server connection. Again, no problem.

OTOH, some applications need to keep exclusive access to certain files, and it may cause problems there. It seems that this would only happen when running two copies as the same user, but would limit the problems to, say, your bookmarks not getting updated correctly.

[ Reply to This | # ]

Launch multiple instances of any given application
Authored by: erikh on Jan 09, '06 04:30:18PM

Sudo never changes the home directory - that is, if you're joe, and your home directory is /Users/joe, this will happen:

$ echo $HOME
/Users/joe
$ sudo bash
# echo $HOME
/Users/joe

Since safari most likely uses some mutation of $HOME to determine where the library path is (which is where your settings are stored), it's most likely that this is the problem.

To solve this:

sudo -H [command]

Which will set the home directory to the user you're targetting (in this case, root).



[ Reply to This | # ]
If you use zsh...
Authored by: discordantus on Jul 16, '03 06:45:53PM

if you happen to use the z shell, you should know that you need to end the command in '&!' instead of just '&'. Since zsh tries to clean up after itself, it'll sig-hup the jobs when you exit the terminal. puttin the bang after the ampersand makes it disown the job, and it will ignore it from then on.

if you forget the bang, you can always manually disown the job by typing "disown".



[ Reply to This | # ]
Launch multiple instances of any given application - without the terminal!
Authored by: gabester on Aug 02, '07 10:57:37AM
If you accordingly modify the script from this hint you can use this for just about any application without having to keep terminal open. This could be particularly handy to help novice Mac users with poorly designed apps that require multiple instances.

[ Reply to This | # ]
With Independent Preferences
Authored by: alexmathew on Sep 23, '08 01:09:21PM
All these comments are technical but none address the root problem (no pun intended) - which is that by using the script, the new instance picks up the existing preferences defeating one of the main reasons for this hint for me.

On the other hand, this shareware - Pseudo - from Brian does the Job perfectly!
http://personalpages.tds.net/~brian_hill/pseudo.html

Pseudo is a drag-and-drop application that allows you to launch other applications in the OSX Desktop as the System Administrator or 'root'.

To use: drop an application icon onto the Pseudo icon, or into the Drop Target window of an already running copy of Pseudo.

You will be asked for your password, and the program will be launched with their administrative privileges.

New in 1.2: You can now optionally store your password in your keychain so you don't need to enter it every time.

In addition, you can create a 'Launch document' that will launch a program when double clicked in the Finder. Just drop a program into a Launch document window to set the launch path. You can optionally set it to quit Pseudo after it launches the program. This provides a very convenient way to launch commonly used programs as root.

I'm paying the Shareware fee! Thanks Brian!

[ Reply to This | # ]