Disk or Volume path help needed
Disk or Volume path help needed
- Subject: Disk or Volume path help needed
- From: Robert Kiolbassa <email@hidden>
- Date: Tue, 12 Jul 2005 17:43:50 -0500
Hello,
I need to access a number of network drives. I cannot figure out how to take
a file path I use in one part of my script to mount the server, and use that
info to test if the server is already mounted. I get an error if the drive
is already mounted. Sorry if I am using some network terms loosely in this
post, I'm not a network guy.
I have a list of servers in a variable used to choose a server to mount. The
server information is set up like this: "smb://ri-fs07.myComp.org/MyShare/".
I am able to mount them okay if the server is not already mounted using
Tell application "Finder"
Set networkLoc to " smb://Main.myComp.org/MyShare/"
Set theUsualUser to "jonesb" -- valid username
mount volume networkLoc as user name theUsualUser
-- will get password dialog box, though ignores user name part
End tell
Result: file " MyShare:"
The two ways I can check if a volume is already mounted don't seem to
resolve to the "smb://..." format. I can get a list of mounted disks which
return as the server names.
set diskList to (do shell script "ls /Volumes")
Result:
"Server 1
MyShare
My_HD"
And I can see if a disk is already mounted saying:
if exists disk "MyShare" then
display dialog "it exists"
end if
Event Log reads:
tell application "Finder"
exists disk "MyShare"
true
display dialog "it exists"
{button returned:"OK"}
end tell
Essentially, what I need to do is to test whether
"smb://ri-fs07.myComp.org/MyShare/" from my variable, exists using that
path, or get the share name and compare against the list or "...exists"
preferably without using TIDs.
Thanks, in advance.
Bob Kiolbassa PM122
Interactive Publishing Specialist
Rotary International
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden