Messages app - chat details capture

Hi Guys

First off Im a totally newbie to Applescript so iv little to no experience with it. Im currently trying to figure out how I can create a script that when I am on a specific chat in jabber in the messages app I can run it and it will capture all the names of the people in the particular chat from the “details” section and then allow me to search those names in say an excel file and then present them on a display dialog with the username and other details i have on such particular person contained within the excel file.

Iv had a good look through the messages dictionary and tinkered around with writing some of the script but I’m not getting anywhere with it really. Im really not sure where to start in regards capturing the usernames from the details section, if anyone could help me on this it would a great help. just to note none of the people in these chats are my “buddies” in my buddy list.

Thanks in advance