[Pythonmac-SIG] AppleScript guru needed
kjray
kjray@ix.netcom.com
Mon, 25 Sep 2000 10:02:06 -0700
>Hi folks,
>I just ran into a problem with MacPython OSA support. Two problems,
>actually:
>1. The CodeWarrior suite declares both a property "project document"
>and a class "project document". As you wil understand this does not
>work well, as these both end up in the same namespace, and both with
>the same name "project_document". Is it legal OSA to have properties
>and classes with the same name? If it is: can anyone think of a
>workaround for MacPython?
>
>2. Aepack does not handle passing classes as arguments. If anyone
>feels like fixing this: please be my guest. The symptom is that if you
>do "xxx.make(new=classname)" it should pass
>aetypes.Type(classname.wantd). Hmm, maybe if this is fixed the
>previous problem isn't a problem anymore.... Oh sigh, my brain always
>turns inside out when I try to reason about OSA:-(
[...]
As far as I know, a 'property' is a data member of a class.
e.g. (in AppleScript):
set <property> of <object> to <value>
set visible of awindow to true
tell application "CodeWarrior"
get project document -- an property of the application which is
-- an instance of the of type "project document"
...
By the way a Java application can be scripted from AppleScript after you
use the AppleScript editor to generate an 'aete' from the _running_ Java
application... if a java class has a 'set' and 'get' methods, AppleScript
refers to that as a property.
class javaclass
{
public int getMyFoo(){...};
public int setMyFoo(){...};
}
translates to AppleScript:
tell application "java app"
set MyFoo of ajavaobject to 1
get MyFoo of ajavaobject
end tell
I'm not a guru, so I suggest posting your request for help in
<news:comp.mac.programmer.help>,
<news:comp.mac.programmer.codewarrior>, and
<news:codewarrior.mac>
And maybe someone at <http://www.applescriptsourcebook.com/> can help --
or even someone at Apple itself -- do you have a (free or $$) Apple
Developer membership?
Are you working on "Mac:Contrib:PythonScript:"?
Or something that generated python from 'aete' resource, like (I assume)
"CodeWarrior_Standard_Suite.py"?
By the way, each application defines its own versions of its suites --
suites are not _really_ standardized -- so I think the best way to parse
an 'aete' resources is to generate a single python module putting all the
classes from all of the app's suites into that module -- better still if
this could be done at run-time whan a python script tries to send
apple-events to an application.
Or maybe I don't know what I'm talking about :-/.