Re: Inexplicable Crash in -[NSAppleScript executeAndReturnError:]
Re: Inexplicable Crash in -[NSAppleScript executeAndReturnError:]
- Subject: Re: Inexplicable Crash in -[NSAppleScript executeAndReturnError:]
- From: Steve Mills <email@hidden>
- Date: Fri, 23 Jan 2015 13:40:02 -0600
On Jan 23, 2015, at 13:25:58, Jerry Krinock <email@hidden> wrote:
>
> Can anyone explain this weird crash report I got from a user and symbolized? The last thing my code does (frame 24 in the call stack below), is to send -[NSAppleScript executeAndReturnError:]. The crash says someone tried to set a *dictionary* object with a nil key. How could I have done that?
>
> NSString* source ;
> source = [NSString stringWithFormat:
> @"tell application \"%@\"\n"
> @"activate\n"
> @"present last logged error\n"
> @"end tell",
> [[NSBundle mainAppBundle] bundlePath]
> ] ;
>
> where [[NSBundle mainAppBundle] bundlePath] returns “com.mycompany.MyApp”. MyApp indeed has a 'present last logged error’ AppleScript command defined, and it works.
I can't find any docs for "present last logged error". How do I set up a state so that it will do something? I'm trying your code here and it executes fine, probably because there is no last logged error. I tried first sending an AppleScript that asked for document 1, which generated an error because there is no document.
--
Steve Mills
Drummer, Mac geek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden