AppleScript: Getting last chat received but not last chat :P
Posted: Wed May 21, 2008 9:12 pm
Hello,
I'm playing with Adium's AppleScript triggering capability and am referencing the following link to get chat information:
http://trac.adiumx.com/wiki/AppleScript_Support_1.2
The goal is to figure out who sent me the most recent chat message. So far I'm able to trigger AppleScript when a message is received, and also get the nickname of the contact of "the last chat" like this:
However, that seems based on the order of chat tabs, not most recent message. If I'm chatting with a friend in the first tab of the chat window, and a second friend is chatting with me in a second tab to the right (index of 2), if the first friend chats, the code above still returns my second tab friend's nickname. - not what I want
As a note, I think "chats" refer to a whole conversation, not an individual message. I also gather that the messages themselves are not accessible directly, so finding out the latest message contact may be difficult? Any thoughts?
Thanks in advance.
I'm playing with Adium's AppleScript triggering capability and am referencing the following link to get chat information:
http://trac.adiumx.com/wiki/AppleScript_Support_1.2
The goal is to figure out who sent me the most recent chat message. So far I'm able to trigger AppleScript when a message is received, and also get the nickname of the contact of "the last chat" like this:
Code: Select all
tell application "Adium"
try
set nickname to display name of contact of last chat
display dialog nickname
end try
end tellAs a note, I think "chats" refer to a whole conversation, not an individual message. I also gather that the messages themselves are not accessible directly, so finding out the latest message contact may be difficult? Any thoughts?
Thanks in advance.