• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Finding a volume name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Finding a volume name (From: Matthew Healey <email@hidden>)

  • Prev by Date: Re: text to list
  • Next by Date: [solution] Quicktime Broadcaster Auto-start streaming
  • Previous by thread: Finding a volume name
  • Next by thread: Re: Finding a volume name
  • Index(es):
    • Date
    • Thread