sirgood Posted June 20, 2011 Share Posted June 20, 2011 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 = 3Dim $buddies[$num][2] = [["User1",0], ["User2",0], ["User3",0]]$IMClassName="[CLASS:IMWindowClass]" ; 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 EndIf Next ENdIf NextExit Link to comment Share on other sites More sharing options...
somdcomputerguy Posted June 20, 2011 Share Posted June 20, 2011 Try with this function, ControlGetText. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
sirgood Posted June 20, 2011 Author Share Posted June 20, 2011 Tried the folllwing no luck using info from Windows Info $text = ControlGetText("[CLASS:IMWindowClass]", "", "Internet Explorer_Server2") Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now