Re: Looking for a disk in disks
Re: Looking for a disk in disks
- Subject: Re: Looking for a disk in disks
- From: Nigel Garvey <email@hidden>
- Date: Mon, 29 Oct 2001 12:50:20 +0000
Mark =?iso-8859-1?Q?Bj=E6rgager?= wrote on Sun, 28 Oct 2001 21:37:29
+0100:
>
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 ?
Just to explain the replies you've received. ;-)
tell app "Finder" to set theDisks to the disks
... returns a list of Finder references to the disks themselves -
something like:
{startup disk of application "Finder", disk "RAM Disk" of application
"Finder"}
Your script compares these references with the word "home", which isn't a
reference but a string, so it's never found.
The solutions either tell the Finder to return the *names* of the disks,
or else use the 'list disks' command from the Standard Additions OSAX
(which also returns a list of the names).
Since 'list disks' is an OSAX command, you don't need to tell the Finder
anything.
NG