[Pythonmac-SIG] Found my OSA problem !
Alexandre Parenteau
aparente@adobe.com
Thu, 17 Oct 2002 11:20:07 -0700
Jack,
I've been telling you over and over I had some AppleScript problems, events
not returning. For example I use Make_Project of CodeWarrior.
Metrowerks_Shell_Suite.py, and it never returned an error when the project
was failing.
The solution came for me around the aetools.unpackevent:
try:
dirobj = ae.AEGetParamDesc('----', '****')
except AE.Error:
pass
else:
parameters['----'] = unpack(dirobj, formodulename)
del dirobj
If I understand correctly, it is expected there is an event of type '----'
to return an error. Well, maybe it used to, but not anymore for me on
Jaguar. Instead, I get directly the 'errn' event coming back. So I changed
the code this way :
try:
dirobj = ae.AEGetParamDesc('----', '****')
except AE.Error:
try:
keyword, dirobj = ae.AEGetNthDesc(1, '****')
except AE.Error:
pass
else:
parameters[keyword] = unpack(dirobj, formodulename)
else:
parameters['----'] = unpack(dirobj, formodulename)
del dirobj
Note I don't like this code, may be I should use AECountItems.
Anyway, that was the source of my problem. How come you don't experience
that ??? I don't understand ! Why the returned event suddenly changed from
'----' (and then 'errn' inside the AEList) to directly 'errn' ?
Anyway, if it could make it for 2.2.2, I want to emphasize that without
this, I don't have CodeWarrior.CodeWarrior functional (tested on CW 7.1,
7.2, 8.0, 8.1, 8.2, Py2.2.1, Py2.3a0, re-generating CodeWarrior.CodeWarrior
or not).
Alex.
--
Alexandre Parenteau
Computer Scientist
Core Technologies, AGM
Adobe Systems, Inc.
408-536-6166