How to get messages beta to start in “hidden mode”

messages

I have installed the beta of messages. I understand the software is beta and I have searched all the Apple messages forums and Google around for a solution but could not find one.

I have set messages to launch upon startup via the icon in the dock as follows:

enter image description here

However when I log into OS X Lion 10.7.3 the primary new message window pops up:

enter image description here

This has the effect of having the messages icon in my dock active in addition to having a new message windows pop up.

My desire is to have messages start up without having a new message windows open upon login. Is there an obvious way to accomplish this? I have tried using minimize scripts which minimize the new message window but still results in having two icons active in my dock as follows:

enter image description here

I have additionally made sure that the "Restore windows when quitting and re-opening apps" setting under general preferences is not on.

Best Answer

You can create an AppleScript to do that for you.

  1. Open AppleScript Editor
  2. Type/paste this in:

    tell application "iChat"
        set minimized of window 1 to true
    end tell

launch "iChat"
tell application "iChat"
    close window 1
end tell
  1. Save as an application somewhere
  2. Open System Preferences > User/Accounts > Login Items
  3. Click Add, navigate to application, add and enable