• 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: Position of an element in a list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Position of an element in a list


  • Subject: Re: Position of an element in a list
  • From: Shane Stanley <email@hidden>
  • Date: Thu, 3 Aug 2017 09:35:27 +1000

On 3 Aug 2017, at 8:45 am, Nigel Garvey <email@hidden> wrote:
>
> the version here seems a bit perverse

But in a very attractive way :-)

It could be good for long lists, although in practice they tend to consist of
items of the same class, in which case you can also use:

set theIndex to (theArray's valueForKey:"lowercaseString")'s
indexOfObject:(aValue's lowercaseString())

Obviously that fails if the list items aren't all strings.

--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>


 _______________________________________________
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

  • Follow-Ups:
    • Re: Position of an element in a list
      • From: Jim Underwood <email@hidden>
References: 
 >Re: Position of an element in a list (From: "Nigel Garvey" <email@hidden>)

  • Prev by Date: Re: Position of an element in a list
  • Next by Date: Re: Position of an element in a list
  • Previous by thread: Re: Position of an element in a list
  • Next by thread: Re: Position of an element in a list
  • Index(es):
    • Date
    • Thread