The method “on windowShouldClose_(_aNotification)” requires that it returns true or false. If you don’t return T/F then the method stalls out/fails.
So, you need to do something like …
on windowShouldClose_(aNotification)
display dialog “Are you closing this window?” buttons {“No”, “Yes”}
if button returned of result is “Yes” then
return true
else
return false
end if
end windowShouldClose
windowShouldClose_() expects a boolean return value to tell the window controller whether the window should be really closed.
To quit an app better use the application delegate method applicationShouldTerminateAfterLastWindowClosed_() and return YES