Mounting disk before continuing
Mounting disk before continuing
- Subject: Mounting disk before continuing
- From: Darrel Sandall <email@hidden>
- Date: Mon, 21 May 2001 17:20:17 -0500
If I may ask a quick question. I am fairly new to Applescript, so
please bear with me. I have written a script to read as follows.
The intent of the script is to mount a disk (which requires me typing
a password into a dialog box. I want to have the script wait for the
disk to successfully mount before continuing, as the second tell
statement refers to an Applescript that launches files off of the
newly mounted disk.
tell application "Finder"
activate
select file "blah" of folder "blah blah" of disk "blah"
open selection
repeat until disk "blah blah blah" is in (list disks)
end repeat
end tell
tell application "Finder"
activate
select file "blah" of folder "blah blah" of disk "blah"
open selection
select file "blah" of folder "blah" of folder "blah" of startup disk
open selection
close (every container window whose index is not 0)
end tell
This works properly in bringing up the login box to mount the disk.
However, it then immediately brings up a dialog box that says,
"Finder got an error: Can't get disk "blah blah blah"" with only a
Stop button on the box. I can continue to type in the login for the
disk and have it mount successfully, but the error box takes the
focus from the login box, requiring me to click back on the login box
to type the password. Unfortunately hitting stop on the error box
then kills the script, so it cannot go on the second tell statement.
Have I done something not quite right, or is there a better way to
have the script wait until the disk is successfully mounted to
continue?
Thanks for any help! I appreciate it.
Darrel