Help with application-scripts calling application-scripts
Help with application-scripts calling application-scripts
- Subject: Help with application-scripts calling application-scripts
- From: Rick Horlick <email@hidden>
- Date: Fri, 9 Mar 2001 16:32:07 -0500
Here's a script (saved as a run-only application) that I've been running on some lab machines. The script runs off of the desktop or in shutdown items and occasionally it seems to cause a lock-up, which is a real problem for us:
launch application "Desktop Printer Cleaner"
run application "Desktop Printer Cleaner"
try
tell application "Finder"
ignoring application responses
open file "RevRdist Prefs" of folder {blah blah} of system folder of startup disk
end ignoring
end tell
end try
"Desktop printer cleaner" is another script that seems to do what I want - find any active or inactive desktop printers, empty them and trash them. RevRdist is an application that compares the files on my disk with a "master folder". All I want the script to do is to run the first script, then launch RevRdist (by opening a RevRdist prefs file) and go away - it works often, but occasionally seems to get stuck and lock everything up, and I'm not sure why. I've tried with and without "ignoring...responses", moving and removing the try statements - it seems to freeze at a slightly different part of the script ("RevRdist" showing in the middle of the menu bar in one case; in the Application menu in another).
In general I'd appreciate some help on the following:
What happens when a script-application calls another application? Does that line wait for an apple event message back from the thing it called, or does the script happily just go on to the next line?
I've read and (partially) understood the handlers section of the old manual, but do I HAVE to write a handler in the called script? What about the calling script? Would this run better if there was some sort of "on quit" clause??
RevRdist is set to quit all open applications, and it doesn't quit nicely - it just kills them. My current favorite theory is that this is sometimes quitting the script before the script terminates - is this possible?? Isn't this what "ignoring app responses" is supposed to do for me?? Say, "just execute this command and proceed to the next line"! How could RevRdist launch before the script just exited the ignoring, tell and try clauses?
Any suggestions would be welcome.
Thanks,
Rick Horlick