• 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's compileAndReturnError always succeeds
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSAppleScript's compileAndReturnError always succeeds


  • Subject: Re: NSAppleScript's compileAndReturnError always succeeds
  • From: Andrew Farmer <email@hidden>
  • Date: Thu, 4 Jun 2009 00:37:03 -0700

On 3 Jun 2009, at 19:47, Paul J. Lucas wrote:
Given that NSAppleScript objects are always supposed to run on the main thread, I created a small "proxy" object to use:
<snip>

If I compile a valid script, it works as expected; however, if I compile a gibberish script, e.g., "foo", compileAndReturnError doesn't fail, i.e., it returns YES and errorDict is still nil.


Why?

Have you tried it with any other gibberish scripts? "foo" is a syntactically valid script which returns the value of the variable foo - it just happens to error out at runtime because the variable isn't defined.


A better choice would be something like "$" which actually fails to parse.
_______________________________________________


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's compileAndReturnError always succeeds (From: "Paul J. Lucas" <email@hidden>)

  • Prev by Date: Re: QTCaptureSession class reference
  • Next by Date: Touchscreens and control scaling
  • Previous by thread: NSAppleScript's compileAndReturnError always succeeds
  • Next by thread: delegate dealloc in NSToolbar customItem
  • Index(es):
    • Date
    • Thread