Re: NSAppleScript crash on executeAndReturnError
Re: NSAppleScript crash on executeAndReturnError
- Subject: Re: NSAppleScript crash on executeAndReturnError
- From: "James J. Merkel" <email@hidden>
- Date: Sun, 28 Nov 2004 16:51:46 -0800
On Nov 28, 2004, at 1:51 PM, Charles Srstka wrote:
On which line is it crashing?
It crashes on:
finderComment = [[theScript executeAndReturnError: &theError]
stringValue];
On Nov 28, 2004, at 2:08 PM, Nick Zitzmann wrote:
Are you running the AppleScript in a thread other than the main
thread? NSAppleScript is not thread-safe, and may crash the
application if used from a thread other than the main thread.
I'm running this in the main thread.
Maybe I'm being a little paranoid on this, since the file that's handed
to this method is always an existing file (i.e. its not a filename
entered by the user. So it should always be a valid path.)
On the other hand, if I have this script in Script Editor:
tell application "Finder"
get comment of file " "
end tell
then I get the error message:
"Finder got an error: Can't get comment of file \"\"."
But Script Editor doesn't crash. So apparently scripting in Cocoa is
not as robust as in Script Editor.
Jim Merkel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden