• 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: Looking for a disk in disks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re:Looking for a disk in disks
      • From: Mark Bjærgager <email@hidden>
  • Prev by Date: Re: Hotmail folders in OE
  • Next by Date: Re: Removing html Tags From Text
  • Previous by thread: Re: Looking for a disk in disks
  • Next by thread: Re:Looking for a disk in disks
  • Index(es):
    • Date
    • Thread