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.
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"
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…)
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"
try
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
getLWSN()
if return is true then
render()
else
return
end if
else
display dialog what buttons {"Oh."} default button 1
end if
end try
end render