• 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: Strange error...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Strange error... (From: Glenn Sugden <email@hidden>)

  • Prev by Date: Re: Strange error...
  • Next by Date: Re: Strange error...
  • Previous by thread: Re: Strange error...
  • Next by thread: Scripting TextEdit Save As HTML?
  • Index(es):
    • Date
    • Thread