• 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: Class/Properties syntax baffles me
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Class/Properties syntax baffles me


  • Subject: Re: Class/Properties syntax baffles me
  • From: Chris Page <email@hidden>
  • Date: Mon, 6 May 2002 03:45:27 -0700

On Sunday, May 5, 2002, at 10:56 , Doug McNutt wrote:

It never crossed my mind that a temporary intermediate variable would be required. Does anybody know why AppleScript differs from FORTRAN or C in this regard?

At 18:26 +0100 5/5/02, Simon Topliss wrote:
Works for me (10.1.4).

tell application "Interarchy 5.0.1"
set fwr to frontwindowrecord
name of fwr
end tell

The issue at hand is that "x of y of z of..." is a reference (or "object specifier") and AppleScript hands this entire construct to the application to handle. If the reference contains something the application doesn't handle, you get an error result. As it happens, most applications don't handle most of the built-in AppleScript stuff, so you have to "get" the part that the application handles, then use AppleScript to handle the rest.

For example, an application might have a "production date" property whose value is an AppleScript date object. You can get the property with:

set x to production date

Now, date has a "day" property, which you can then get from AppleScript with:

get day of x

However, since the application most likely doesn't implement any of the properties of date, you can't write:

get day of production date

Because the application doesn't know how to get "day of production date", it only knows how to get "production date", yet AppleScript leaves it entirely up the application to handle the whole reference.

Some might say this is a design flaw in AppleScript, and that it should provide a means for applications to handle part of a reference and leave it up to AppleScript to handle the rest.

--
Chris Page - Mac OS Lead, Palm Desktop - Palm, Inc.

The other, other Chris.



--
Chris Page - Mac OS Lead, Palm Desktop - Palm, Inc.

"When you connect to the Mac in trouble state, it is lovely and others
The forcing Sad iPod was indicated. One time to try seeing you want
It will do also the air, but the one which is not seen happy is"
- Bad translation from a Japanese iPod article



--
Chris Page - Mac OS Lead, Palm Desktop - Palm, Inc.

The other, other Chris.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Class/Properties syntax baffles me (From: Doug McNutt <email@hidden>)

  • Prev by Date: Scripting Microsoft Outlook
  • Next by Date: Re: [ANN] MacTech Article source posted
  • Previous by thread: Re: Class/Properties syntax baffles me
  • Next by thread: Re: Class/Properties syntax baffles me
  • Index(es):
    • Date
    • Thread