• 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: Can't invoke NSApplication's terminate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't invoke NSApplication's terminate


  • Subject: Re: Can't invoke NSApplication's terminate
  • From: Dave <email@hidden>
  • Date: Tue, 28 Dec 2010 12:47:39 -0600

Nathan,

I figured the quit handler went the way of idle and is no longer being supported in Applescript Objective-C, but I just tried it and 'tell me to quit' works. But now it invokes the application's delegate applicationShouldTerminate_() handler. And when I tried supplying the normal Applescript quit handler things got weird. The quit handler would run but did nothing to terminate the application, i.e., no different than a normal applescript run handler being invoked. And whenever I tried using a 'continue' command in the quit handler it always gave me a run-time error, never going on to quit the application or invoke applicationShouldTerminate_.

So the answer seems to be 'tell me to quit' is still supported but the old 'quit' handler isn't. Seems odd to me.

-- Dave

On Dec 28, 2010, at 9:14 AM, Nathan Greenstein wrote:

I use
tell me to quit
Is Shane's method more proper?
--
Nathan Greenstein
email@hidden





On Mon, Dec 27, 2010 at 22:42, Dave <email@hidden> wrote:
I've tried the following to cause my application to terminate. They don't do anything and no syslog messages are emitted. I've resorted to calling my own Obj-C method to invoke terminate.

  tell current application to terminate_(me)
    current application's terminate_(me)
    current application's NSApplication's terminate_(me)
    current application's sharedApplication()'s terminate_(me)


My Objective-C method, which does work, is:

+ (void)TerminateApplication
{
[NSApp terminate:nil];
} 

-- Dave


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


Do not post admin requests to the list. They will be ignored. applescriptobjc-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Can't invoke NSApplication's terminate
      • From: Shane Stanley <email@hidden>
References: 
 >Can't invoke NSApplication's terminate (From: Dave <email@hidden>)
 >Re: Can't invoke NSApplication's terminate (From: Nathan Greenstein <email@hidden>)

  • Prev by Date: Re: Can't invoke NSApplication's terminate
  • Next by Date: Re: me and my do not refer to your script's class
  • Previous by thread: Re: Can't invoke NSApplication's terminate
  • Next by thread: Re: Can't invoke NSApplication's terminate
  • Index(es):
    • Date
    • Thread