On Friday, August 8, 2003, at 11:21 AM, Ronald Oussoren wrote:
> On Friday, 8 August, 2003, at 17:10, Bob Swerdlow wrote:
>
>> I finally got around to upgrading my application to use PyObjC 1.0
>> beta 1
>> from PyObjC 0.9.
>>
>> The upgrade was easy, but I ran into one problem:
>>
>> appleScript = NSAppleScript.alloc().initWithSource_(strScript)
>> result = appleScript.executeAndReturnError_(None)
>>
>> produced this error for the second line:
>>
>> TypeError: Need 0 arguments, got 1
>>
>> This had not happened in PyObjC 0.9. When I changed it to:
>>
>> result = appleScript.executeAndReturnError_()
>>
>> the code worked and the error went away.
>>
>> I'm not sure I understand why this is so, as that function is
>> documented as:
>> - (NSAppleEventDescriptor *)executeAndReturnError:(NSDictionary
>> **)errorInfo
>
> That's a bug in version 0.9. The 'executeAndReturnError:' method has
> an output argument, you don't have to supply those when calling
> methods.
But won't result then be a tuple of the (AE descriptor, error info),
not just the AE descriptor? (That's probably not what Bob's expecting,
so I just wanted to clarify for him.)
Cheers!
--Chris Ryland / Em Software, Inc. / www.emsoftware.com
|