AppleScript get chat message text? - work around?

An instant messenger which can connect to AIM, GTalk, Jabber, ICQ, and more.
Post Reply
ultrus
Harmless
Posts: 5
Joined: Wed Mar 19, 2008 3:43 pm

AppleScript get chat message text? - work around?

Post by ultrus »

I'm seeing clues that this may not be possible? Here are my original thoughts:

I'm attempting to make an AppleScript fortune cookie trigger when any chatter other than myself mentions the word "fortune". I'm close, but am having trouble accessing the incoming chat message:

tell application "Adium"
set chatText to the ???? of last chat of the last chat window

if chatText contains "fortune" then
set displayName to the display name of account of last chat of the last chat window
send the active chat message "Fortune for " & displayName & ": You will make money someday."
end if
end tell

Any thoughts on this? Also, does this look right for the last received chat message for any window? Thanks much. :D
mtimmsj
Frappa
Posts: 144
Joined: Wed Jun 08, 2005 6:55 pm
Location: Olympia, WA

Re: AppleScript get chat message text? - work around?

Post by mtimmsj »

I don't believe this is possible yet. The chat class does not have a property for the contents of the chat.
ultrus
Harmless
Posts: 5
Joined: Wed Mar 19, 2008 3:43 pm

Re: AppleScript get chat message text? - work around?

Post by ultrus »

I see. Maybe there's a way I can parse the chat log file. Any idea where this file is located?
ultrus
Harmless
Posts: 5
Joined: Wed Mar 19, 2008 3:43 pm

Re: AppleScript get chat message text? - work around?

Post by ultrus »

It looks like there are several chat log files, well organized though. I can probably make something to parse/interpret last chat message, but looks like a challenge. heh.
mtimmsj
Frappa
Posts: 144
Joined: Wed Jun 08, 2005 6:55 pm
Location: Olympia, WA

Re: AppleScript get chat message text? - work around?

Post by mtimmsj »

My recollection is that this functionality is being worked on, but it's not complete yet. Please see:

http://trac.adiumx.com/ticket/7615

And:

http://trac.adiumx.com/ticket/6214
Post Reply