Jump to content
Sign in to follow this  

Get Text from Lync IM Client

Recommended Posts


I am trying to read the text of a Lync IM client and respond with predefined text strings. My script works getting the active window and sending text but does not read the text beforehand successfully. I have cut the script down to just getting text for troubleshooting. I can get it to return a "0" or "" depending on what line I use. See my comments in code.

#include <Array.au3>

Dim $num = 3

Dim $buddies[$num][2] = [["User1",0], ["User2",0], ["User3",0]]


; Get all the active/minimized Lync windows

$winList = WinList($IMClassName)

For $a = 0 to $winList[0][0]

MsgBox(0, "WinList", $winList[$a][0]) ;Displays a number showing how many IM Windows were found and the Titles of Windows

; Activate Lync window if there is any

If WinActivate($winList[$a][0]) <> 0 Then

; Get title from IM

$title = WinGetTitle($winList[$a][0], "") ;Getting Titles of all IM Windows

$text = WinGetText("[CLASS:IMWindowClass]", "") ; Returns Blank

;$text = WinGetText("[CLASS:User1]", "") ;Returns a Zero

;$text = WinGetText($IMClassName) ;Returns Blank

; Loop thro all coworkers

For $r = 0 to UBound($coworkers) - 1

; Read Message text if name matches

If StringInStr($title, $buddies[$r][0])>0 And $buddies[$r][1]=0 Then

MsgBox(0, "Text read was:" , $text) ; Suppose to Display text if a match from array is found






Share this post

Link to post
Share on other sites

Tried the folllwing no luck using info from Windows Info

$text = ControlGetText("[CLASS:IMWindowClass]", "", "Internet Explorer_Server2")

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.