Re: Strange error...
Re: Strange error...
- Subject: Re: Strange error...
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 5 Aug 2005 14:30:44 -0400
So if I'm reading that link right, a good rule of thumb is that any
time you want to use some gettable value "blah" in an expression, you
can skip the "get" in two cases:
1. it's a readonly value (you can't "set" it),
or
2. you're using it as the entire expression, all by itself (as in
"set x to blah")
Otherwise, you have to use (get blah). Right?
On 8/5/05, Emmanuel <email@hidden> wrote:
> At 10:53 AM -0700 8/5/05, Glenn Sugden wrote:
> >Tell Application "Finder"
> > set winLeft to item 1 of (bounds of first window)
> >End Tell
> >
> > Results in: Finder got an error: Can't get item 1 of bounds of window 1.
> >
> > FWIW, so does: set winLeft to (item 1 of (bounds of first window))
> >
> > What the heck am I missing here?
>
> It is because what you really want is that Finder get the bounds of
> window 1, and then that AppleScript extract the first item of that
> quantity. Here you are asking Finder to resolve the whole descriptor
> "first item of the bounds of the first window". Just force the
> evaluation of the intermediate quantity with "get".
>
> More lines on this issue at:
> <http://www.satimage-software.com/en/gotchas.html> (To get or not to get)
>
> Emmanuel
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden