Thanks Jim - I will look into this properly, at a later date
I am working with this. My app has the plist key to start without icon, and NSApplicationActivationPolicyRegular makes icon and menu pop back up fine. But when I set to NSApplicationActivationPolicyAccessory or NSApplicationActivationPolicyProhibited the app becomes invisible so the user has no way to get back to it.
To avoid that, I will do as you advise and have the user select the “Hide icon and menu” setting for the next app start with no immediate effect.
For the first run, I will show the icon and menu for the Apple reviewer not to freak.
Thank you Jim. Your code is great
I just found a way around. If I display a global floating window by showmodal with “Click OK to continue”, the app does not disappear while menu and dock icon become invisible