Re: Mounting disk before continuing
Re: Mounting disk before continuing
- Subject: Re: Mounting disk before continuing
- From: Darrel Sandall <email@hidden>
- Date: Tue, 22 May 2001 17:36:03 -0500
David,
Thanks for the input! I appreciate any and all help!
I tried using two separate scripts, and also tried using two separate
Tell statements in one script (as you see below). I both cases, the
result was the same. The login box to mount the disk container
appeared, and almost instantly, I got the error box described in my
first post. The error box occurred because the second script ran
before the disk was mounted, and since it calls files from the disk
which had not yet mounted, it errors out.
What I basically need to do is to have the script stop until the disk
is mounted successfully on the desktop (even if it takes me a couple
shots at getting the password typed correctly). I could put in a
timed wait command, but I would prefer that it just wait for the disk
to mount, so that if I did not type the password immediately, it
would just sit patiently and wait for me.
FYI, the file referred to in the first Tell statement is the name of
the disk container, which resides on one of my disk partitions. So I
think I have tried what you suggest. If I misread your response,
please let me know. Thanks again for your help!
Darrel
You should mount the volume with Applescript first, then the rest
will follow OK.
At 5:20 PM -0500 5/21/01, Darrel Sandall wrote:
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.
--
:: dmgraham information solutions ... database, web & more ::
david m graham
10353 san diego mission rd., #107c, san diego, ca 92108
619.322.9698
http://www.dmgraham.n3.net
_______________________________________________
applescript-users mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/applescript-users