Thanks to everyone who has helped me this far…
I’m writing a script that’s run automatically from within filemaker when the database is opened. Since the script is being run from within the filemaker app itself, it keep filemaker busy until the script is completed. What I"m trying to do is to mount a remote volume that the database needs to access. Part of the debugging process is dealing with the contingency of if the volume is not available or takes too long to mount.
Craig Williams helped me solve the problem of Finder being kept occupied while the volume is being mounted - THANK YOU!
http://bbs.macscripter.net/viewtopic.php?id=27836
The second part of the equation is that because the script is being run from within Filemaker, filemaker is unaccessible until the script completes - which is a two minute time out if the volume is not available. It seems like an eternity to wait, especially is I know the volume is not available but want to get into the database anyway. Ideally, I would like to set the script in motion to mount the volume and then continue on to filemaker and allow the script to finish in the background, but filemaker is kept busy for as long as the script is running, even if I ‘tell application “FileMaker Pro” to activate’.
I wish I could separate the script from filemaker and run it independently, but that’s not possible as this has to be an all inclusive solution, and it seems that I cannot call an external applescript from within filemaker.
Since I can’t run the script in the background or independently of filemaker, the best thing I can think of is to allow the user to cancel the script if it’s taking too long. Here’s what I have in mind, but I have no idea how to go about it:
Display a dialog - “trying to mount the volume” with a cancel button
script continues to the next step, trying to mount the volume, while dialog is still displayed
if the user clicks “cancel” in the dialog at any point during the mount process, the script exits.
What I can’t figure out is how to 1) make the script display the dialog and then continue to the next step (it seems to have to wait for an answer before it continues)
and 2), make the script “watch” for the cancel input from the user and exit when the button returns “cancel”.
It makes sense to have the script loop or repeat until button returned is “cancel”, but I can’t figure out how to do this while also performing the ‘mount volume’ step.
I’ve played with looping, ignoring, repeat, and several variations, but I’m a little lost.
Any help?
Thanks in advance!