• 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: When does "item x of" auto-iterate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When does "item x of" auto-iterate?


  • Subject: Re: When does "item x of" auto-iterate?
  • From: Christopher Nebel <email@hidden>
  • Date: Tue, 18 Mar 2008 09:59:00 -0700

On Mar 17, 2008, at 10:19 AM, Thomas Summerall wrote:

    set myList to { {"a","b"}, {'"c","d"} }
    item 1 of my List

returns {"a","b"} as expected

   tell application "Finder"
         set myDisks to disks
         set firstDisk to item 1 of myDisks
   end tell

returns the first volume, as expected.

   tell application "Finder"
         set myItems to item 1 of disks
   end tell

returns a list containing item 1 of each volume. Kind of neat, but why? Bug or feature?

It's a feature, and it works when the right-hand side of the "of" is a range specifier of some sort (such as "disks", which is equivalent to "every disk"), as opposed to a list object as in the first case. Bear in mind that a specifier is *not* the same thing as its value.



--Chris Nebel AppleScript Engineering

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >When does "item x of" auto-iterate? (From: Thomas Summerall <email@hidden>)

  • Prev by Date: Re: OOP - Factory Scripts
  • Next by Date: Re: OOP - Factory Scripts
  • Previous by thread: When does "item x of" auto-iterate?
  • Next by thread: OOP - Factory Scripts
  • Index(es):
    • Date
    • Thread