Re: "a reference to"
Re: "a reference to"
- Subject: Re: "a reference to"
- From: Brennan <email@hidden>
- Date: Sat, 19 Jan 2008 11:45:27 +0100
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?
Ever since I learned a little LISP, I usually put parentheses around
expressions in AppleScript, especially those which contain spaces.
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))))
I have no clue which of those parentheses are strictly necessary, but I
find the code easier to read, easier to debug, and, because I am
constantly reminded which terminology belongs together, easier to edit.
It goes a long way to addressing some of the more irritating occult issues
that Hamish has mentioned earlier on this thread.
Parentheses are your friends. They might break the English-like syntax of
AppleScript, a bit but they make the code clearer, and you rarely or never
have to worry about dereferencing with 'get' (which really *does* screw up
the English-ness).
Brennan
_______________________________________________
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