Finding a server name of a volume
Finding a server name of a volume
- Subject: Finding a server name of a volume
- From: Phil Coulson <email@hidden>
- Date: Thu, 16 May 2002 15:44:08 +0100
Dear All
Being completly new to both applescript and Mac's so any help I get would be
a bonus.
My script is monitoring a folder. When the script runs chooser is used to
select a folder.
This could be on any volume that is currently mounted. Each time after that
I need to
check that the volume is still mounted if not re-mount it. This is where I
get the problem,
I can use the 'Mount Volume' command but I need the server name and I can't
work how to
get the server name of the volume. I don't wan't to use scripting additions
as I would have to
load these on to many machines and I've only just learnt how to switch on a
Mac!
try
set NewFolder to choose folder with prompt "Select the folder you wish to
forward to:"
on error
quit of me
return
end try
set NewVol to GetVol(NewFolder) of me
set FolderToMoveToVol to NewVol
set FolderToMoveTo to NewFolder
set servname to ? -- Tried info for FolderToMoveToVol but doesn't work
if FolderToMoveToVol is in (list disks) then
set WasNotMounted to false
else
try
mount volume FolderToMoveToVol on server servname as user name usrname
with password passw
on error errmsg
display dialog "in error for " & errmsg
return TimeToSleep * 60 -- Sleep time * seconds in a minute
end try
set WasNotMounted to true
end if
on GetVol(theFolder)
tell application "Finder"
set temp to (disk of item theFolder) as text
set total to count (character of temp)
set temp to characters 1 through (total - 1) of temp as text
end tell
return temp
end GetVol
Any help would be grateful
Phil the novice.
****************************************************************************
Any views or opinions are solely those of the author
and do not necessarily represent those of Express Newspapers
****************************************************************************
The information transmitted is intended only for the person
or entity to which it is addressed and may contain confidential
and/or privileged material.If you are not the intended recipient
of this message please do not read ,copy, use or disclose this
communication and notify the sender immediately. It should be
noted that any review, retransmission, dissemination or other
use of, or taking action in reliance upon, this information by
persons or entities other than the intended recipient is prohibited.
Email communications may be monitored
****************************************************************************
##EXN2000##
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.