Running multiple copies of applications

I have a program that compliles an arguement line for a rendering program, and writes the equivalent of a batch file to a specific directory. Then when I launch the rendering engine, it takes this info and starts kicking out frames. Cool.

My problem is that when one instance (copy) of the rendering application is running, I cannot start another instance. The OS seems to think that I’m referring to the first instance, and won’t launch the second (even though the line to launch the program specifies the path as well as the name of the app).

Is there an easy way to be specific about where the copy of the application is that you want to launch, so that you could launch multiple copies?

I’ve tried all sorts of variations of “run application X” or “tell application X to activate” or “tell application X to run” and nothing seems to work.

Thanks in advance.

Try this:

tell application "Finder" to open alias "path:to:instance"

And this variation should also work:

tell application "path:to:instance" to run

Yes, it should, but it doesn’t. Just the original instance runs, but not the second…

Frustrating. It’s almost like it’s using a database of where apps live, and will only use the current running app.

Something like this might work. I’ve never tried to run more than one instance of a program so I don’t know.

tell application "Finder" to open file "path:to:batch:file1" using "path:to:application1" 
tell application "Finder" to open file "path:to:batch:file2" using "path:to:application2"


The application I want to launch automatically uses the “batch file.” I don’t have to implicitly tell it to open.

That said, I still can’t get multiple copies of the app to run… If one is running, I cannot launch another.

tell app "Finder" to open whatever

will allways open “whatever”, and nothing different from “whatever”.
Maybe the app you are launching is specifically designed to keep a SINGLE copy of itself running in the same machine/network. But, anyway, the Finder should try opening a second copy. Perhaps you can share the code you are using? (it may be related to your problem…)

Boy… getting close, here…

If I use this, the first copy runs. Then if I change the variable to the path of the second copy, and tell it to go, and I get a message from the Finder: “Finder got an error: Handler can’t handle objects of this class.”

Here’s the weird thing. If I quit and restart my ASS program, and hit the “go” button (which fires off the render() handler, below), it’ll start the second instance.

Here’s my handler, if that helps:

on render()
	log "Started Render"
		set LWSNinst to (CommandDir & "LWSN")
		tell application "Finder"
			open (LWSNinst)
		end tell
	on error what
		if what contains "LWSN" then
			display dialog what buttons {"Oh."} default button 1
			if return is true then
			end if
			display dialog what buttons {"Oh."} default button 1
		end if
	end try
end render


I can open and ‘tell’ different copies of same app on my machine if I give them slightly (or vastly) different names.