• 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
Extracting class of items from list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Extracting class of items from list


  • Subject: Extracting class of items from list
  • From: Andrew Oliver <email@hidden>
  • Date: Tue, 02 Aug 2005 10:02:52 -0700

(10.4.2/AppleScript 1.10)

I'm not convinced this is working as expected (or, at least, as far as *I*
expect), but I'm also not (yet) convinced it's a bug. Can someone explain
this action to me one way or another?

Given a list containing mixed classes:

    set myList to {"word", 123, {"a", "b"}, true}

I know it's possible to extract certain classes of items from the list:

    every text of myList
    --> {"word"}
    every integer of myList
    --> {123}
    every list of myList
    --> { {"a", "b"} }

However when you ask for:

    every text item of myList

You get:
    --> {"word", 123, {"a", "b"}, true}

I can't help thinking that's wrong.
My first expectations were the same as 'every text of myList', and then
every character of the list (as if the list was coerced to a string then
divided up using TIDs), but neither of those are the case.

What's the justification for returning the entire list when asking for text
items of that list?

Andrew
:)

 _______________________________________________
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: Extracting class of items from list
      • From: kai <email@hidden>
  • Prev by Date: Best way to tell if a file copy has finished.
  • Next by Date: Re: Extracting class of items from list
  • Previous by thread: Re: Best way to tell if a file copy has finished.
  • Next by thread: Re: Extracting class of items from list
  • Index(es):
    • Date
    • Thread