Handling a window in a one-window app

Hi

I searched and crawled this forum for hours and days, but couldn’t find a post that solves all the fixes to bring https://zimmer.partners/en/damn-spam to the App Store. Here are my issues:

  • As mentioned above, the app has only one window that is automatically shown when the app is launched.
  • The App Store reviewers now request both a menu item and window controls to dismiss and re-open that window. Therefore I need:
    1. An AppleScript-on-handler that triggers when the window is closed.
    2. An AppleScript-on-handler that triggers when the window is shown (and getting focus) again.

Thanks in advance!,
yours,
Moritz