Page 1 of 1

AppleScript get chat message text? - work around?

Posted: Wed Mar 19, 2008 3:51 pm
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

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

Posted: Wed Mar 19, 2008 4:52 pm
by mtimmsj
I don't believe this is possible yet. The chat class does not have a property for the contents of the chat.

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

Posted: Wed Mar 19, 2008 5:13 pm
by ultrus
I see. Maybe there's a way I can parse the chat log file. Any idea where this file is located?

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

Posted: Wed Mar 19, 2008 5:32 pm
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.

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

Posted: Wed Mar 19, 2008 8:28 pm
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