Launch or Awake test...

How would I go about telling my Xcode app to quit upon failing a test that must be run on launch? I want this test to run before the main window appears so that if the test is not met, the whole thing just quits.

Make sense?

property shouldQuit : true

on launched theObject
	if shouldQuit is true then
		show window "theWindow"
	end if
end launched

This works bet if your window is NOT set to display at launch. Use your code to show the window, rather than the IB setting… this will ensure that your window won’t ever display unless you want it to.

Should this code, then, be in an applescript attached to the main window itself? Also, can you explain the use of the “property” statement as opposed to simply including the test within the “on launched…” portion of the script?