• 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: A Syntax Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A Syntax Question


  • Subject: Re: A Syntax Question
  • From: Shane Stanley <email@hidden>
  • Date: Wed, 09 Jul 2014 12:46:48 +1000

On 9 Jul 2014, at 3:11 am, Paul Berkowitz <email@hidden> wrote:

This is all perfectly normal AppleScript behavior and has always been so.

Mind you, this thread reinforces the point that it's unexpected, which, especially given AS's intended audience, suggests it was not a very good design choice. This is compounded by the way invisible coercion kicks in to make it appear to work the way people expect in some cases. Presumably it was done in than name of making one operator work with multiple classes, rather than, say, separate containment operators for each class. 

Probably the safest thing to do is to avoid the operator altogether for lists, and use a simple handler instead:

on listContainsItem(theList, theItem)
return theList contains {theItem}
end listContainsItem

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

 _______________________________________________
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: 
 >Re: A Syntax Question (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: A Syntax Question
  • Next by Date: Script won't run consistently
  • Previous by thread: Re: A Syntax Question
  • Next by thread: Re: A Syntax Question
  • Index(es):
    • Date
    • Thread