Can't get around "mount failed" - "on error" won't do it - help appreciated
I'm using this syntax to mount a volume, and it works well if the volume can in fact be mounted:
try
mount volume "afp://username:password@NNN.NNN.NNN.NN/MyDir"
on error
display dialog "blah blah"
end try
BUT, if the volume can't be mounted because the directory specified is incorrect, I a dialog saying "Mount Failed" opens with the only option being 'OK'. Under some other mount failure circumstances this dialog doesn't appear, and the script does eventually time out and disappear all by itself. But if this dialog appears, I have no option other than to manually press OK. It stays open forever. This dialog appears before the script passes the error to the display dialog part, so it prevents the "on error" part of the script from running. This is the only example I know of where 'on error' fails to let the scripter move on and manage the error.
What I would really like to do is to get the 'on error' functionality to actually work properly, because I can determine the PID of the process using Terminal and could then kill it using a shell script if , BUT none of this is possible because the script never gets to the 'on error' state because a real human must press the dialog's OK. I can't seem to use system events to send anything to it because the whole applescript just hangs at this point until the OK is checked.
Does anyone know a workaround? I've tried using a with timeout step around the whole thing but also won't work.
Thanks for any advice you could give me.
Chris.
PB_G4_1.5, Mac OS X (10.4.6)