Greetings,

I have a trivial AppleScript that I would like to compile and run under Objective-C. When I try to compile or execute it via compileAndReturnError or executeAndReturnError I'm permanetly receiving a EXC_BAD_ACCESS.

Here's my code:

======= CODE START ===
- (IBAction) simpleScript:(id)sender
{
NSAppleScript* theScript = [[NSAppleScript alloc] initWithSource: @"beep 3"];
        if (theScript != NULL)
        {
                NSDictionary* errDict = NULL;
                // execution of the following line ends with EXC
                if (YES == [theScript compileAndReturnError: &errDict])
                {
                        NSLog(@"compiled the script");
                        [theScript executeAndReturnError: &errDict];
                }
                [theScript release];
        }
}
======= CODE END ===

I did some research and found similar reports that suggested that this might be a threading or garbage collection issue. I'm calling the code in the main thread (i.e. no threading) and also disabled auto garbage collection - without success.

I also tried a variety of other NSAppleScript sample. Whatever I try, my debugger always ends up with a EXC_BAD_ACCESS.

The precise error message in the status bar of the debugger is:

GDB: Program received signal: "EXC_BAD_ACCESS".

I'm running XCode 3.1 under Leopard 10.5.4.

Any thoughts what's going wrong here? Is this a known problem?

Any help is greatly appreciated!

Thanks
-Alex
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to