NSApplicationActivationPolicyAccessory question

Instead of using the plist to hide an app from the dock I wanted to use NSApplicationActivationPolicyAccessory:

NSApplicationMBS.activationPolicy = NSApplicationMBS.NSApplicationActivationPolicyAccessory

But when starting the app that should be hidden I see it about a second in the dock and only then the app is hidden. Bug or feature? High Sierra, MBS 21.2.

Using the plist means this option is active the moment launch services starts to open it. Using it in code means you need to wait for the opening routine to reach that point, issue the command and for it to reach the dock in order for the dock to remove the icon.

Basically the info.plist option is always going to be the quickest way to do this.

Are you trying to fork an existing application into running a second instance of it self?

No, I’m just starting a helper app. I wanted to simplify my zoo of IDE scripts a bit. I’ll revert then.