• 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: "a reference to"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: "a reference to"
      • From: Christopher Nebel <email@hidden>
    • Re: "a reference to"
      • From: has <email@hidden>
    • Re: "a reference to"
      • From: Luther Fuller <email@hidden>
References: 
 >Re: "a reference to" (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Plist entry
  • Next by Date: Re: Plist entry
  • Previous by thread: Re: "a reference to"
  • Next by thread: Re: "a reference to"
  • Index(es):
    • Date
    • Thread