Re: where and whose (what and why?)
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.