Re: Finding a volume name
Re: Finding a volume name
- Subject: Re: Finding a volume name
- From: Richard Morton <email@hidden>
- Date: Mon, 2 Dec 2002 18:20:07 +1100
On Monday, December 2, 2002, at 04:56 PM, Matthew Healey wrote:
I need to retrieve the name of an AppleShare volume currently on the
desktop
(MacOS 9.2.2). I know the volume ends in "Files", but my script doesn't
know
the start of the name.
Is there any way that I can easily do a wildcard search for the complete
volume name?
Here's a list disks variant that deals with the possibility that there
is no disk mounted:
set diskName to ""
repeat with aDisk in (list disks)
tell contents of aDisk to if it ends with "Files" then
set diskName to it
exit repeat
end if
end repeat
diskName -- show the result
Putting it in a handler allows it to be compacted a little:
on diskNameEndsWith(someString)
repeat with aDisk in (list disks)
tell contents of aDisk to if it ends with someString then
return it -- exits here if found
end repeat
return "" -- no disk
end diskNameEndsWith
That would be called like this:
set diskName to diskNameEndsWith("Files")
Cheers,
Disk O Apocalips
_______________________________________________
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.