Re: tracking EXC_BAD_ACCESS error in applescript command

2009-12-21 Thread François Guillet
That was a copy of the original call stack before I subclass NSScriptCommand. 
If I subclass NSScriptCommand and call executeCommand from this subclass, then 
the crash occurs as before, but of course the call stack changes accordingly. 
Anyway I put breakpoints in my subclass' methods to make sure I get through 
them.

I've found a workaround which anyway is the way I originally wanted scripting 
to work. I have the document return an object of (say) FooClass through the 
property foo. Then I declare an object-first command (say check) and implement 
the command handler in the FooClass class. Then the applescript statement :

check foo of front document

does work fine. So I can't find a way of doing "check front document" using 
NSScriptCommand's executeCommand but I can do so on an object contained by the 
document...

Le 21 déc. 2009 à 03:19, Jerry Krinock a écrit :

> 
> 
> On 2009 Dec 20, at 13:50, François Guillet wrote:
> 
>> EXC_BAD_ACCESS error :
>> #0  0x7fff86951466 in -[NSScriptCommand _sendToRemainingReceivers] ()
>> #1  0x7fff86951fe5 in -[NSScriptCommand executeCommand] ()
>> #2  0x7fff8696902e in -[NSScriptingAppleEventHandler 
>> handleCommandEvent:withReplyEvent:] ()
> 
>> I implemented a subclass of NSScriptCommand used both for verb first or 
>> object first command : everything works fine, I can call [[self 
>> evaluatedReceivers] handleCommmand:self] from  executeCommand without any 
>> problem. The EXC_BAD_ACCESS error, though, always happens if I try to call 
>> NSScriptCommand's executeCommand.
> 
> Not sure about the crash, but if you've subclassed NSScriptCommand, should 
> not your subclass name appear in the call stack shown above, instead of 
> NSScriptCommand?  In your sdef, have you specified your subclass to be the 
> Cocoa Class of this command?
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/francois.guillet%40wanadoo.fr
> 
> This email sent to francois.guil...@wanadoo.fr
> 

François





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: tracking EXC_BAD_ACCESS error in applescript command

2009-12-20 Thread Jerry Krinock

On 2009 Dec 20, at 13:50, François Guillet wrote:

>  EXC_BAD_ACCESS error :
> #0  0x7fff86951466 in -[NSScriptCommand _sendToRemainingReceivers] ()
> #1  0x7fff86951fe5 in -[NSScriptCommand executeCommand] ()
> #2  0x7fff8696902e in -[NSScriptingAppleEventHandler 
> handleCommandEvent:withReplyEvent:] ()

> I implemented a subclass of NSScriptCommand used both for verb first or 
> object first command : everything works fine, I can call [[self 
> evaluatedReceivers] handleCommmand:self] from  executeCommand without any 
> problem. The EXC_BAD_ACCESS error, though, always happens if I try to call 
> NSScriptCommand's executeCommand.

Not sure about the crash, but if you've subclassed NSScriptCommand, should not 
your subclass name appear in the call stack shown above, instead of 
NSScriptCommand?  In your sdef, have you specified your subclass to be the 
Cocoa Class of this command?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com