• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSAppleScript crash on executeAndReturnError
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSAppleScript crash on executeAndReturnError
      • From: Charles Srstka <email@hidden>
References: 
 >NSAppleScript crash on executeAndReturnError (From: "James J. Merkel" <email@hidden>)
 >Re: NSAppleScript crash on executeAndReturnError (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Resizing an image inside a text view
  • Next by Date: Re: NSAppleScript crash on executeAndReturnError
  • Previous by thread: Re: NSAppleScript crash on executeAndReturnError
  • Next by thread: Re: NSAppleScript crash on executeAndReturnError
  • Index(es):
    • Date
    • Thread