Mac OS X: open application at login, without showing the main window

I am developing an application that I want to start automatically when the user logs in. There are several answers on how to do this, in particular I'm using the code from this GitHub repository, and it works fine.

What I want now, and couldn't find how to do it, is start the application but without showing the main window. This is only when the application starts on login, if the application is closed and the user opens it with a click in the Dock (or whatever), I want it to show the window.

Is it possible? Any ideas on how to do this?

In the Accounts system preference, where you set the applications that launch on login, there is a "hide" check that does what I want, but I want to do it programmatically.

6
задан informatik01 13 December 2013 в 02:32
поделиться