Adium / Applescript : How to send a specific response to a specific message

Discussion in 'Mac Programming' started by Zanzibar, Mar 19, 2010.

  1. Zanzibar macrumors newbie

    Joined:
    Mar 19, 2010
    #1
    I'm not really familiar with Applescript....but if this would be easy for someone to whip up real quick, I'd be very appreciative.

    I've looked around and not seen any examples of an Applescript for Adium where the script takes the message sent by a particular user as input.

    I'd want the applescript to do something to the affect of:

    If username is "someuser" (or really any user, for that matter), and they send a message where the complete message text is "test123" (and no other text), the script makes me automatically respond with "test received".

    or, If the text is "are you there?" , the response is "not now".

    just a script that checks for 2 conditions and responds with a specific response for each condition if it is met.

    The conditions are mutually exclusive (for example, if the complete message text sent is "test123", by definition it cannot be "are you there?")

    Any help appreciated.

    Thanks.
     
  2. HiRez macrumors 603

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #2
    Yeah, it's a problem, unless they've added to their AppleScript dictionary lately. I was trying to do the same thing a while ago. You can call a script when a message is received but as far as I can see there's no way to connect that with the specific message text that was sent, other than parsing the log files (using the user name of the current chat) and trying to match up time stamps, which is pretty dicey. That makes it pretty useless.

    This is actually a more general problem for all kinds of AppleScripts that has frustrated me and really limited its usefulness: you can trigger scripts on events but they almost never have a mechanism to receive context info about the event (who/what triggered it, message text, etc.).
     

Share This Page