Mike Chambers

code = joy

Using AppleScript to connect to a Jabber Chat Room with Adium

with 4 comments

I have been having a lot of fun hanging out in the Flash Platform Chat room I set up last week. However, it can be a little bit of a hassle to connect to the room depending on which Jabber / XMPP client you are using. I am working on an AIR app for the chat that will make it super simple, but until then you will have to use your own client.

I use Adium on Mac OS X to connect and it works really well, except that it can be a bit of a hassle to connect to the room every time. The latest beta allows you to bookmark the room to make it easier to connect (Contact > Add Group Chat Bookmark), but at least for me works inconsistently.

So, I put together a simple AppleScript that you can save that will open the chat room in Adium.

First, type the following script in Script Editor on OS X:

tell application "Adium"
	set rn to (current date) - (date "Friday, January 1, 1904 12:00:00 AM")
	GetURL ("xmpp:flashplatform_chat@conference.mikechambers.com?join&" & rn)
end tell

Update : Added random name / value pair to fix problem with script only working once per Adium instance (thanks to Nicolas Noben who suggested the fix).

You can test it from within the Script editor by pressing the run button.

Note that it will use the first Jabber account it finds in your account list (File > Preference > Accounts), so make sure to move the one you want to use to the top.

Right now, it looks like you have to have Adium running in order for it to work (I think this has something to do with the certificate dialog warnings that come up). Anyways, I suspect once the next release of Adium is out, you wont need this, but until then, it might prove useful.

In order to save it to make it reusable, just select File > Save As, set the File type to “Application Bundle” and then save the file to the directory of your choice.

To use it, launch Adium, and the run the Script by double clicking it (or any other way you launch an application).

The script seems to still have some issues, and will only work the first time you try to use it. After that, you have to restart Adium. If anyone know what is going on (Im an AppleScript noob), or has any suggestions, just post them in the comments.

Written by mikechambers

August 18th, 2008 at 11:28 pm

Posted in General

4 Responses to 'Using AppleScript to connect to a Jabber Chat Room with Adium'

Subscribe to comments with RSS or TrackBack to 'Using AppleScript to connect to a Jabber Chat Room with Adium'.

  1. Hey Mike.

    I believe if you add a random value at the end, it (kinda) works. Similar to the good old days, when loading xml.

    ?join&ran=123

    it worked for me, but the contact list doesn’t show anymore?

    Not much but a pointer.
    Nicolas.

    Nicolas Noben

    19 Aug 08 at 6:08 am

  2. @Nicolas Noben

    Yes! that was the issue. Good catch. I updated the script based on your suggestion.

    Ill look into the contact list issue.

    mike chambers

    mesh@adobe.com

    mikechambers

    19 Aug 08 at 9:16 am

  3. @nicolas


    it worked for me, but the contact list doesn’t show anymore?

    Are you running the adium beta? I get the same thing in the beta, but not in the stable release.

    mike chambers

    mesh@adobe.com

    mike chambers

    19 Aug 08 at 9:33 am

  4. There’s an easier, non-code way to bookmark a jabber group chat in the current version of adium.

    -Simply select the tab with the group chat.
    -Click the address book icon at the top of the window.
    -Add it to an existing group in your buddy list or create a new one.
    -Double click this entry in your buddy list next time you launch adium

    Andy Fontana

    28 Aug 08 at 8:16 am

Leave a Reply