Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Applications > Mac Applications and Mac App Store

Reply
 
Thread Tools Search this Thread Display Modes
Old May 13, 2013, 05:23 PM   #1
arnoz
macrumors regular
 
Join Date: Jun 2007
Location: Belgium
Send a message via AIM to arnoz
Messages: show notification when buddy becomes available

One thing I miss from iChat and Growl: the notification showing when one of your friend just connected.

I found 2 scripts: one to send anything to Notification Center and another one to monitor when a Messages contact becomes available but I haven't build able to create a proper Apple Script until now.

Any help?
PS: code NOT mine

PHP Code:
using terms from application "Messages"
    
    
on buddy became available theBuddy
        
        tell application 
"Messages"
            
tell theBuddy
                
-- set _service to service type of service of theBuddy
                set _service to 
"Jabber"
                
set _handle to handle of theBuddy
                set grrCURL to 
"Messages:compose?service=" _service "&id=" _handle "&style=textchat"
                
                
if _handle contains "google" then
                    set _platform to 
"GTalk"
                
else if _handle contains "gmail" then
                    set _platform to 
"GTalk"
                
else
                    
set _platform to "Messages"
                
end if
                
                
set grrTitle to full name
                set grrDescription to _platform 
"
status message
                set grrPriority to 0
                set grrIcon to image
            end tell
        end tell
        growlNotify
(grrTitlegrrDescriptiongrrPrioritygrrIcongrrCURL)
        
        
        
tell application "Notifications Scripting"
            
            
--  This is required for calling the user notification event handlersThe handlers can be in a different script file.
            
set event handler script to ("buddy became available")
            
            -- 
The user info parameter is a recordThe supported data types are textintegerrealbooleandatealiasfile and POSIX file.
            
set dict to {theName:"Notifications Scripting"theVersion:"1.0"theScript:event handlers script path}
            
            -- 
Create a notificationOnly the title is required at minimum.
            -- Use 
"Default" for the default sound played by the user notification center.
            -- 
See the Notifications Scripting dictionnary for more informations.
            
display notification "My title" subtitle grrDescription message "My Message" user info dict
            
        end tell
    end buddy became available
    
end using terms from 
arnoz is offline   0 Reply With Quote
Old May 15, 2013, 06:14 AM   #2
arnoz
Thread Starter
macrumors regular
 
Join Date: Jun 2007
Location: Belgium
Send a message via AIM to arnoz
Anyone is an AppleScript pro?
arnoz is offline   0 Reply With Quote
Old May 16, 2013, 01:29 AM   #3
allan.nyholm
macrumors 6502
 
Join Date: Nov 2007
Location: Denmark
Send a message via AIM to allan.nyholm Send a message via Skype™ to allan.nyholm
Have you taken a look at this http://tiagodovale.deviantart.com/ar...AGES-285399682

You have to go through Growl for this.
allan.nyholm is offline   0 Reply With Quote
Old May 16, 2013, 04:52 AM   #4
arnoz
Thread Starter
macrumors regular
 
Join Date: Jun 2007
Location: Belgium
Send a message via AIM to arnoz
I have seen many scripts like this but I want to use only Notificaiton Center.
arnoz is offline   0 Reply With Quote
Old May 30, 2013, 05:42 AM   #5
arnoz
Thread Starter
macrumors regular
 
Join Date: Jun 2007
Location: Belgium
Send a message via AIM to arnoz
Anyone else has an idea?
Thanks
arnoz is offline   0 Reply With Quote
Old Aug 26, 2013, 06:16 AM   #6
arnoz
Thread Starter
macrumors regular
 
Join Date: Jun 2007
Location: Belgium
Send a message via AIM to arnoz
Anyone?
arnoz is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Applications > Mac Applications and Mac App Store

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Sent messages from Messages app on Macbook do not show up in OS X or iPhone justbask OS X 10.8 Mountain Lion 0 Aug 9, 2013 04:14 PM
Messages continue to show notification number? khare905 iOS 7 1 Jul 11, 2013 07:26 PM
Messages and Notification Center PatriotInvasion OS X 10.8 Mountain Lion 2 Apr 13, 2013 06:18 PM
Messages - Buddy List? JediSkipdogg OS X 10.8 Mountain Lion 5 Oct 12, 2012 03:14 PM
Messages: Is it supposed to have an active buddy list? east85 OS X 10.8 Mountain Lion 1 Aug 9, 2012 12:00 AM

Forum Jump

All times are GMT -5. The time now is 07:14 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC