Re: Filter reference form question
Re: Filter reference form question
- Subject: Re: Filter reference form question
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 17 Dec 2003 18:03:08 -0800
On 12/17/03 11:19 AM, "Christopher Nebel" <email@hidden> wrote:
>
On Dec 17, 2003, at 7:42 AM, Brennan wrote:
>
>
> OK, all well and good, but what I would dearly love is to also have the
>
> right hand side of the test to operate in the same scope:
>
>
>
> every foo whose width is less than its length
>
>
>
> This kind of filter fails - apparently, the thing we are comparing it
>
> with occurs in a different scope, so even if our foo class has a
>
> 'length' property, a 'can't get' error occurs. Apparently 'it' refers
>
> to the tell target of the containing object, rather than the one being
>
> filtered.
>
>
>
> I'm afraid this is impossible... unless someone can enlighten me.
>
>
This does seem to be impossible, but not for the reason you suppose.
>
AppleScript parses and sends out the request as you desire -- both
>
"width" and "length" are specified as properties of "the object being
>
examined".
>
>
Unfortunately, no application I've checked handles this correctly: the
>
Finder simply errors, and Cocoa applications (I tried TextEdit and
>
Mail) return all elements or none, as if the test were always true or
>
always false. (AppleScript built-in types don't support "whose" in the
>
first place, so the problem is moot -- yes, fixing that is on my to-do
>
list.)
>
It doesn't fail in _every_ application:
tell application "Microsoft Entourage"
get every event whose start time = its end time
end tell
--> {event id 2063 of application "Microsoft Entourage"}
--
Paul Berkowitz
_______________________________________________
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.