How to Abort Application Launch Early On

Another beginner’s question:

I have an ASObjC application with a custom view class. So there are two scripts: the app delegate and the custom view class. When the app starts the following actions are invoked in the following order:

If there is a problem with the files needed for the app, I could determine that in the initWithFrame action and abort the launch, but the first action that responds to a quit command is the applicationWillFinishLaunching action. Hence, I end up building the whole UI and then quitting. I can loop around the contents of the first three actions, but that seems silly. Obviously, there is a another way.

What do you mean by “action that responds to a quit command”? Can’t you just tell NSApp to terminate_?

What I mean is that the only handler in which the old-fashioned AppleScript quit works is applicationWillFinishLaunching_. Whereas, in previous efforts,

current application’s terminate_(current application)
current application’s terminate_(me)
current application’s applicationShouldTerminate_(current application)
current application’s applicationShouldTerminate_(me)

does nothing ” not even generate an error ” no matter which handler I put it in.

Incidentally, it is really cool of you to provide all this help to fools like me. Thanks.

So what happens with “current application’s NSApp’s terminate_(me)”?

That is what I’m looking for. Works like a charm. Thank you again.