This is useful for utility apps and allows the user to close the main window and have it reopened when the app is re-activated.
-- activates the main window clicking when on dock icon (if it is not already visible)
on applicationShouldHandleReopen_hasVisibleWindows_(self,visible)
if visible then
return true
else
-- mainWindow is an outlet that's linked to the main Window in IB
mainWindow's makeKeyAndOrderFront_(self)
return false
end
end