Re: Looking for a disk in disks
Re: Looking for a disk in disks
- Subject: Re: Looking for a disk in disks
- From: Rob Jorgensen <email@hidden>
- Date: Sun, 28 Oct 2001 16:14:27 -0500
On 10/28/2001, Mark Bjfrgager commented:
How can I test if a certain volume is mounted on the mac ?
I am trying to use
Tell app "Finder" to set theDisks to the disks
If "home" is in theDisks then beep
Only it never does, how can use this ?
This appears to work on my setup (OS 9.1/AppleScript 1.6/various
scripting additions):
-- Begin Snippet 1 --
tell application "Finder" to set theDisks to name of disks
repeat with i in theDisks
if contents of i is "home" then beep
end repeat
-- End Snippet 1 --
This one works too, but it wouldn't be specific if more than one disk
name contained "home".
-- Begin Snippet 2 --
tell application "Finder" to set theDisks to name of disks
if theDisks contains "home" then beep
-- End Snippet 2 --
The decision of which one to use depends on what you want to do if
"home" is present in theDisks.
Later,
Rob Jorgensen
Ohio, USA