[Pythonmac-SIG] Re-- AppleScript guru needed

Vincent Marchetti vincem@en.com
Tue, 26 Sep 2000 11:15:41 -0400


IANAG but,

Jack Jensen asked about legality of having classes and properties sharing
the same name
in AppleScript. I don't know if is legal (or even if there is a
"controlling legal authority" for
AppleScript and OSA naming), but I always had trouble trying to do this in
scriptable applications
I have written. It seems to me the problem is how the AppleScript
interpreter converts a phrase
like
"get project document of target 1"
to an object specifier. My experience is that in this case the correct
specifier is made when
"project document" is both the name of a class and the name of a property
(of class target); however
the interpreter gags when trying to make a more complex object reference,
for example using
whose -clauses
i.e. "get targets whose (name of project document is "parrot") "

In short, within AppleScript and OSA, sharing names might be legal, but not
very robust. However, it
seems that MetroWerks did it in setting up the scripting interface to
CodeWarrior IDE.

Under MacPython, the script writer should know whether the class
project_document or the
property project_document is required. It seems to me the best solution is
to rename the
Python class property to project_document_property, and a corresponding
change to
element target._propdict .

As for the call to make, I've been using simply
app.make(new = classname.want, with_properties = etc..)

Vince Marchetti