brett 0 Posted May 9, 2004 (edited) How would i input the text of an instant message? i can see what i type in the visible text with the autoit window spy, but how would i put that text into a variable? Brett Edited May 9, 2004 by brett -Brett Share this post Link to post Share on other sites
brett 0 Posted May 9, 2004 When i do that, i float my mouse around and get one of these, but all in just about the same place so i dont know why the names are changing...but i can't get any text with any of them. The only thing i got text with is WinGetText(), but i got all the html... I get all of these names for the last control under mouse: _Oscar_PersistantCombo1 (Hidden), Edit1, Ate32Class1, ComboBox1 For the HTML from WinGetText(), i get: <HTML><BODY BGCOLOR="#ffffff"><B><FONT COLOR="#0000ff" LANG="0">BrettHomeComp<!-- (9:48:59 PM)--></B></FONT><FONT COLOR="#0000ff" BACK="#ffffff">:</FONT><FONT COLOR="#000000"> hey</FONT><BR><BODY BGCOLOR="#ffffff"><B><FONT COLOR="#ff0000">BrettHomeComp<!-- (9:49:00 PM)--></B>:</FONT><FONT COLOR="#000000"> hey</FONT></BODY></HTML> But i need to get the actual message from the instant message, which is "hey", how can i get only that? -Brett Share this post Link to post Share on other sites
scriptkitty 1 Posted May 9, 2004 (edited) if you wanted to clean out the HTML, you could try this quick parse: $x='<HTML><BODY BGCOLOR="#ffffff"><B><FONT COLOR="#0000ff" LANG="0">BrettHomeComp<!-- (9:48:59 PM)--></B></FONT><FONT COLOR="#0000ff" BACK="#ffffff">:</FONT><FONT COLOR="#000000"> hey</FONT><BR><BODY BGCOLOR="#ffffff"><B><FONT COLOR="#ff0000">BrettHomeComp<!-- (9:49:00 PM)--></B>:</FONT><FONT COLOR="#000000"> hey</FONT></BODY></HTML>' $test=_HTMLtrim($x) msgbox(1,"",$test) func _HTMLtrim($_aX) $aX=Stringsplit($_aX,"<") $_out="" for $i=1 to $aX[0] if Stringinstr($aX[$i],">") then $aX[$i]=StringTrimleft($aX[$i],Stringinstr($aX[$i],">")) $_out=$_out & $aX[$i] next return $_out endfunc edit.. doesn't work if you use > or < in the chat. Edited May 9, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers. Share this post Link to post Share on other sites
brett 0 Posted May 9, 2004 if you wanted to clean out the HTML, you could try this quick parse: $x='<HTML><BODY BGCOLOR="#ffffff"><B><FONT COLOR="#0000ff" LANG="0">BrettHomeComp<!-- (9:48:59 PM)--></B></FONT><FONT COLOR="#0000ff" BACK="#ffffff">:</FONT><FONT COLOR="#000000"> hey</FONT><BR><BODY BGCOLOR="#ffffff"><B><FONT COLOR="#ff0000">BrettHomeComp<!-- (9:49:00 PM)--></B>:</FONT><FONT COLOR="#000000"> hey</FONT></BODY></HTML>' $test=_HTMLtrim($x) msgbox(1,"",$test) func _HTMLtrim($_aX) $aX=Stringsplit($_aX,"<") $_out="" for $i=1 to $aX[0] if Stringinstr($aX[$i],">") then $aX[$i]=StringTrimleft($aX[$i],Stringinstr($aX[$i],">")) $_out=$_out & $aX[$i] next return $_out endfunc edit.. doesn't work if you use > or < in the chat.w0w that code is confusing i dont get it lol -Brett Share this post Link to post Share on other sites
scriptkitty 1 Posted May 9, 2004 func _HTMLtrim($_aX) $aX=Stringsplit($_aX,"<"); make an array each new element starts with < $_out=""; set up a blank output for $i=1 to $aX[0]; for next set on all elements. if Stringinstr($aX[$i],">") then $aX[$i]=StringTrimleft($aX[$i],Stringinstr($aX[$i],">")); if you find a > remove all text before it. $_out=$_out & $aX[$i]; combine what is left. next return $_out; return combined stuff. endfunc AutoIt3, the MACGYVER Pocket Knife for computers. Share this post Link to post Share on other sites