• 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: where and whose (what and why?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: where and whose (what and why?)


  • Subject: Re: where and whose (what and why?)
  • From: Emmanuel <email@hidden>
  • Date: Mon, 26 May 2003 08:44:58 +0200

At 1:37 PM +0930 26/05/03, Nathan Day wrote:
>I have never been able to work out the where or whose filter, they sometimes work and sometimes don't, can someone explain to me why this is, for example the follow script work
>
> tell application "Finder"
> every item of folder (choose folder) where its name begins with "a"
> end tell
>
>but none of the following do
>
> set theText to "aa bb cc dd ab bc cd de"
> every word of theText whose first character is "a"

How the "whose" clauses will work depends on how its implementation was designed in the component or the application that will handle the script.

What happens here is that AppleScript does not implement the "whose" clauses so you can neither say:

---------------------------------------
set theList to {{name: "Bart", age: 14}, {name: "Homer", age: 41}}
set theKid to first item of theList whose age < 20
---------------------------------------

nor use any whose clause on text as you're trying to do.

On the other hand, Finder implements rather thoroughly the whose clauses, so you can use it on files as you are observing.

Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >where and whose (what and why?) (From: Nathan Day <email@hidden>)

  • Prev by Date: Re: I'd like to attach a file to Mail.app
  • Next by Date: Re: URL Access/IE5.x download question...
  • Previous by thread: Re: where and whose (what and why?)
  • Next by thread: Re: I'd like to attach a file to Mail.app
  • Index(es):
    • Date
    • Thread