Re: "a reference to"
Re: "a reference to"
- Subject: Re: "a reference to"
- From: has <email@hidden>
- Date: Sat, 19 Jan 2008 15:44:43 +0000
On 19 Jan 2008, at 10:45, Brennan wrote:
On 16/01/08 at 9:55, Christopher Nebel <email@hidden> wrote:
tell app "Finder" to set scrWd to item 3 of (bounds of window of
desktop)
Parentheses in an object specifier affect grouping (this can be
useful
when you've got more than one "whose" clause)
I can only urge you all to follow this advice. Inserting 'get' all
over
the place is kinda ugly, no?
I think you missed the point: parentheses are NOT an alternative to
using explicit 'gets'. The example Chris gives above will fail unless
you insert an explicit 'get' command to force AppleScript to get the
'bounds of window of desktop' reference:
tell app "Finder" to set scrWd to item 3 of (get bounds of window of
desktop)
As a result I almost never have problems with a missing 'get'. If it
does
happen, it can almost always be resolved with adding more carefully
placed
parentheses, such as;
set dr to (display dialog (name of (info for (choose file))))
There is nothing in that expression that requires an explicit 'get';
the parentheses are solely to disambiguate AppleScript's ambiguous
syntax so that it can parse without compiler error. (That parentheses
should be necessary simply to prevent the compiler tripping over
itself is a design flaw, although AppleScript isn't unique in this
regard; only worse than unusual.)
has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden