Applescript issue when mounting SMB shares on OS X
Applescript issue when mounting SMB shares on OS X
- Subject: Applescript issue when mounting SMB shares on OS X
- From: "Kinsella, John R." <email@hidden>
- Date: Wed, 28 Nov 2001 12:46:36 -0600
We run an AppleScript that, using DAVE from Thursby under OS 9,
automatically mounts 2 drives (My Storage and My Web) based on the username
and password the user inputs. We'd like to do the same thing with OS X
without using DAVE, but rather the built in SMB tools. Here's the issue
that I need some expert help with.
The My Storage drive may be in one of 2 places, Server1 or Server2, for the
example. Server1 hold storage for one group of users, server2 for everyone
else. What I need to be able to do is to tell the finder to try to open the
location on server1. If it finds the correct share on server1, then great,
all is well. But if it DOESN'T find the correct share on Server1, it needs
to look for the share on Server2. Now I've written this the way I think it
should work, but when I get to the point that it can't find the share on
Server1, the Finder throws up a type error 1 that the share cannot be found.
As far as I can tell, this shouldn't happen, because I told the script the
following
try
open location my_storage
on error
--change the location of my storage
end try
try
open location my_storage
end try
I thought this would suppress the finder error from the user, but the error
appears anyway. I need to be able to check server1, if the share doesn't
exist there (because there's no way to figure out which server the share is
on otherwise) then without an error to the user, try it again on server2.
I'm guessing this has something to do with the way SMB is implemented in
10.1, that forces that error on screen no matter what, but I hope that's not
the case, as we'll have to use the OS X version of DAVE then.
Help!!
John Kinsella
-------------
"The surest way to corrupt a youth is to teach him to hold in higher regard
those who think alike rather than those who think differently."
--Nietzsche