Unless you are totally out of the world, otherwise you must be using growl in your Mac to configure notifications. It is one tool which I totally want in my mac so that I don’t need to switch every time to the window about what someone have written in the chat or what is the track iTunes started playing and lots of other tasks.
If you are also using this, then I am sure you must have noticed that iChat doesn’t support growl notifications and it sometimes really hurts. But the scripting interface in iChat really makes that easy to fix.

So, to achieve this, simply follow the steps. First open the apple script editor. Copy and paste the following code into apple script editor.

property growlAppName : "Growl iChat"

property notificationNames : {"Buddy Became Available", ¬
    "Buddy Became Unavailable", ¬
    "Message Received", ¬
    "Completed File Transfer"}
property defaultNotificationNames : {"Buddy Became Available", ¬
    "Buddy Became Unavailable", ¬
    "Message Received", ¬
    "Completed File Transfer"}

using terms from application "iChat"

    on buddy became available theBuddy
        my registerWithGrowl()

        tell application "iChat"
            tell theBuddy
                set theTitle to full name & " became available"
                set theDesc to status message
                set theIcon to image
            end tell
        end tell
        my notify(theTitle, theDesc, theIcon, "Buddy Became Available")
    end buddy became available

    on buddy became unavailable theBuddy
        my registerWithGrowl()

        tell application "iChat"
            tell theBuddy
                set theTitle to full name & " went away"
                set theDesc to status message
                set theIcon to image
            end tell
        end tell
        my notify(theTitle, theDesc, theIcon, "Buddy Became Unavailable")
    end buddy became unavailable

    on message received theText from theBuddy for theTextChat
        my registerWithGrowl()

        tell application "iChat"
            set theIcon to image of theBuddy
            set theTitle to full name of theBuddy
        end tell
        my notify(theTitle, theText, theIcon, "Message Received")
    end message received

    on completed file transfer theTransfer
        my registerWithGrowl()
        tell application "iChat"
            tell theTransfer
                if transfer status is finished then
                    if direction is incoming then
                        set theTitle to "Received File "
                        set theDesc to "from "
                    else
                        set theTitle to "Sent File "
                        set theDesc to "to "
                    end if

                    set theTitle to theTitle & (file as string)
                    set theDesc to theDesc & full name of buddy
                end if
            end tell
        end tell
        my notify(theTitle, theDesc, theIcon, "Message Received")
    end completed file transfer
end using terms from

on registerWithGrowl()
    tell application "GrowlHelperApp"
        register as application growlAppName all notifications notificationNames default notifications notificationNames icon of application "iChat"
    end tell
end registerWithGrowl

on notify(theTitle, desc, icondata, notificationName)
    tell application "GrowlHelperApp"
        if icondata is "" or icondata is missing value then
            notify with name notificationName title theTitle description desc application name growlAppName icon of application "iChat"
        else
            notify with name notificationName title theTitle description desc application name growlAppName image icondata
        end if
    end tell
end notify

Now just save this script at safe place where you don’t delete it accidentally with name “Growl iChat”.

Once it’s done, open the iChat.

Open iChat preferences

Go to Alerts

Click on the event “Message Received”

iChat Preferences

Now simply click on “Choose Script”. Browse to the location where you saved the script and select that.

Once  you have selected it, it should show up like the same whatever it’s showing in my screen.

Now your iChat should send the events to growl and you should see the growl notifications, the way you had setup it in growl preferences. You can go and customize over there for iChat.

There are also options for “Buddy Became Available”, “Buddy Became Unavailable” and “Message Received” which you can configure in the same way.

I had tested this with Growl 1.3 and growl 2.0 and it was working.

Hope this helped. Stay tuned for more.

If you enjoyed this post, make sure you subscribe to my RSS feed!!!!

No related content found.