• 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: Is there the equivalent of "any item of"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there the equivalent of "any item of"


  • Subject: Re: Is there the equivalent of "any item of"
  • From: Thomas Summerall <email@hidden>
  • Date: Fri, 18 Apr 2008 13:36:41 -0400

I think some picks a random item.

At 01:28 PM 4/18/2008, Philip Aker wrote:
On 08-04-18, at 10:22, Thomas Summerall wrote:

Let's say I have a string I want to check for any one of several substrings.

Is there a way to do something like this:

     set stringToSearch to "I have a brand new pair of rollerskates"
     if stringToSearch contains any item of {"new","rollerblade} then
          -- at least one item from the list was found
     end if

I know you can iterate through the list with repeat, I was just wondering about a concise way to do it.

set stringToSearch to "I have a brand new pair of rollerskates"
if (stringToSearch contains some item of {"new", "rollerblade"}) then
return some word of stringToSearch
end if

Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Sent from my SE/30
 _______________________________________________
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: 
 >Is there the equivalent of "any item of" (From: Thomas Summerall <email@hidden>)
 >Re: Is there the equivalent of "any item of" (From: Philip Aker <email@hidden>)

  • Prev by Date: Re: Is there the equivalent of "any item of"
  • Next by Date: Re: Is there the equivalent of "any item of"
  • Previous by thread: Re: Is there the equivalent of "any item of"
  • Next by thread: Re: Is there the equivalent of "any item of"
  • Index(es):
    • Date
    • Thread