Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.8: Automatically open the Messages chat window Apps
I was annoyed by a behavior of Messages.app. When a friend sends me a message the chat window will not open automatically. Instead the Messages app icon will get a badge and bounce a couple of times in the dock.

But if I'm not currently at the computer, and since I do not use the Dock to launch apps and I have the Dock always hidden, I could easily miss a message for a long time. So I came up with the following solution.

First open /Utilities/AppleScript.app and paste the following into the script editor:
using terms from application "Messages"
	on message received theText from theBuddy for theChat
		set visible of window "Messages" to true
	end message received	
end using terms from
Pick a name and save the script in the scripts folder ~/Library/Scripts.

Next open up /Applications/Messages.app and do the following:
  • Under Preferences select Alerts.
  • Under Event select Received Message.
  • Tap Run an AppleScript and select your previously saved script under the Pop-Up menu.
Now when you receive a new message while you are away from the computer you have an open window with the message waiting for you.

[crarko adds: I haven't tested this one. You need to be running 10.8 or later to have the Messages application, of course.]
    •    
  • Currently 2.83 / 5
  You rated: 3 / 5 (6 votes cast)
 
[6,809 views]  

10.8: Automatically open the Messages chat window | 8 comments | Create New Account
Click here to return to the '10.8: Automatically open the Messages chat window' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automatically open the Messages chat window
Authored by: michelle_eris on Apr 09, '13 11:15:56AM

You need to be running 10.8 to run Messages. There was a public beta of Messages that ran under 10.7, but it expired when 10.8 was released.



[ Reply to This | # ]
Automatically open the Messages chat window
Authored by: crarko on Apr 10, '13 06:04:20AM

I have edited the hint to correct this. Thanks!

Craig A.



[ Reply to This | # ]
Automatically open the Messages chat window
Authored by: Likkie on Apr 09, '13 10:00:38PM

Hmm doesn't work for me :( Get error...

Event: Message Received
File: iMessagePopUp.scpt
Error: Canít set window "Messages" to true.



[ Reply to This | # ]
Automatically open the Messages chat window
Authored by: crarko on Apr 10, '13 06:02:11AM

Sorry, I think I lost a group of comments about this hint this morning. The general idea was that people were getting error messages (708?) when trying to run this. I hope the original poster will chime in with some advice.

Craig A.



[ Reply to This | # ]
10.8: Automatically open the Messages chat window
Authored by: Jokke72 on Apr 13, '13 11:25:48AM

I don't now what happened but now im getting same error messages



[ Reply to This | # ]
10.8: Automatically open the Messages chat window
Authored by: peterpk on Apr 23, '13 02:09:58PM
With some tinkering I found a fix to the "Can't set window Messages to true" error. I think it was getting confused because the name of the Messages window changes when a new message comes in, since it adds "(1 unread)" to the title.
using terms from application "Messages"
	on message received theText from theBuddy for theChat
		set mWin to the first window whose name starts with "Messages"
		set (the visible of mWin) to true
	end message received
end using terms from


[ Reply to This | # ]
10.8: Automatically open the Messages chat window
Authored by: jhersco on Jul 08, '13 09:49:35AM

I copied this script exactly and saved it. When I receive a new message, the Messages window opens along with another window that shows the following:

An error occurred while executing an AppleScript event handler.

Event: Message Received
File: Open Messages Window.scpt
Error: Canít make visiblle of window id 1204 into type reference.

I'm looking for a fix. Thanks.



[ Reply to This | # ]
10.8: Automatically open the Messages chat window
Authored by: jhersco on Jul 09, '13 12:12:51PM

Correction to my previous comment:

I copied this script exactly and saved it. When I receive a new message, the Messages window does not open. Instead an error message shows the following:

An error occurred while executing an AppleScript event handler.

Event: Message Received
File: Open Messages Window.scpt
Error: Canít make visiblle of window id 1204 into type reference.

I'm looking for a fix. Thanks.



[ Reply to This | # ]