Disabling save menus for a document

I added this to my application script:

on applicationShouldTerminateAfterLastWindowClosed_()
	return YES  
end applicationShouldTerminateAfterLastWindowClosed_

That makes the script now call windowShouldClose_ when the user clicks close window.

on windowShouldClose_(sender)
	log "windowShouldClose_"
	return gBlnEditMode = false
end

However, it gets called AFTER the user is presented with a “do you want to save” dialog. If I could just get rid of THAT I’d be set.

A document based app is NOT supposed to quit after the last window is closed

Yes, I quickly discovered that and turned it to NO. Using that routine was only a means to get the windowshouldclose command to execute.