• 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: [Solved]NSAppleScript returning wrong error info
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Solved]NSAppleScript returning wrong error info


  • Subject: Re: [Solved]NSAppleScript returning wrong error info
  • From: Vinay Prabhu <email@hidden>
  • Date: Wed, 19 Mar 2008 08:54:58 +0530

Initializing the errorInfo to nil did the trick.

When no error occurs, NSAppleScript will not touch the error dictionary.
So I was trying to access the dictionary pointing to junk memory.

Thanks for the help.
-Vinay

On Mar 18, 2008, at 7:44 PM, Nir Soffer wrote:


On Mar 18, 2008, at 11:47, Vinay Prabhu wrote:

I am trying to create a NSAppleScript object using a applescript file.
The code is as follows,


NSDictionary* errorInfo;
NSAppleScript *script = [[NSAppleScriptalloc] initWithContentsOfURL: scriptURL error: &errorInfo];


As per the documentation, on return 'errorInfo' should point to a dictionary containing error messages.

No, the docs say:

"On return, if an error occurs, a pointer to an error information dictionary."

If an no error occurs, the value is undefined. Check for errors by testing the return value, not the error dictionary.


Best Regards,

Nir Soffer




_______________________________________________

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


References: 
 >NSAppleScript returning wrong error info (From: Vinay Prabhu <email@hidden>)
 >Re: NSAppleScript returning wrong error info (From: Nir Soffer <email@hidden>)

  • Prev by Date: Re: Adding spaces to an NSString
  • Next by Date: Re: User Defaults Controller - IB
  • Previous by thread: Re: NSAppleScript returning wrong error info
  • Next by thread: NSTableViewnot reflecting data changes
  • Index(es):
    • Date
    • Thread