I have an script application (not stay open), called "Dead Man Agent.app" with handlers, getInfo() and putInfo(someInfo) which pass/receive information to/from a client script. I call it like this:
tell application "Dead Man Agent" launch set theInfo to getInfo() end tell
... and later, after changing the info,
tell application "Dead Man Agent" launch putInfo(someInfo) end tell
Sometimes the putInfo works, sometimes it gets a "connection invalid" message. If I copy the exact same call to a stand alone test script, it always works.
It seems as if the first "launch" somehow screws up the second one. But I get the same error message if I take the second one out.
As I understand it, when you launch an app, it opens but does not run. How long does it stay open? Does it close after each call or do I need a separate launch for each call? Do I have to wait for it to finish closing before making the second call? How can I tell if it is still open?
Steve ------------------ OS X 10.6.8, AppleScript 2.1.2
|