• 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: Weeding out items from list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weeding out items from list


  • Subject: Re: Weeding out items from list
  • From: "Nigel Garvey" <email@hidden>
  • Date: Sat, 26 Nov 2005 12:38:51 +0000

Michelle Steiner wrote on Fri, 25 Nov 2005 20:38:19 -0700:

>On Nov 25, 2005, at 7:31 PM, Nigel Garvey wrote:
>
>>   tell application "Finder" -- or "System Events"
>>     set listing to name of every disk where it is not local volume and
>> its name is not "Network"
>>   end tell
>
>Doesn't this read better, though?
>
>tell application "Finder" -- or "System Events"
>	set listing to name of every disk whose local volume is false and
>name is not "Network"
>end tell

Oh I don't know. It's certainly more descriptive of how the information's
obtained, but I occasionally like to get creative and pull out the
'where' syntax. :-)  Either way makes better reading than the dictionary
explanation for 'local volume': "Is the media a local volume?" (Ouch!)

>BTW, when the only non-local volume is Network, using the Finder
>results in an error, but using System Events results in an empty list.

Ach yes. Sorry. I stuck in the 'name of' bit between testing and posting.
If no such disk exists, you can't get its name. Ah well. Here's some more
good reading:  :-)

  tell application "Finder"
    tell (every disk whose local volume is false and name is not "Network")
      if (it exists) then
        set listing to its name
      else
        set listing to {}
      end if
    end tell
  end tell

NG


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Weeding out items from list
      • From: kai <email@hidden>
References: 
 >Re: Weeding out items from list (From: "Nigel Garvey" <email@hidden>)
 >Re: Weeding out items from list (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Weeding out items from list
  • Next by Date: Re: Weeding out items from list
  • Previous by thread: Re: Weeding out items from list
  • Next by thread: Re: Weeding out items from list
  • Index(es):
    • Date
    • Thread