Klexen Posted June 6, 2007 Posted June 6, 2007 (edited) If winexists("","Chat") then Winclose("","Chat") I want to be able to use more than one keyword. Such as Winexists("","Chat","chat","MySpace") then Winclose("","Chat,"chat""MySpace") Any ideas? Edited June 6, 2007 by Klexen
Valuater Posted June 6, 2007 Posted June 6, 2007 (edited) Maybe... If WinExists("","Chat") And WinExists("","MySpace") Then... ??? 8) Edited June 6, 2007 by Valuater
ResNullius Posted June 6, 2007 Posted June 6, 2007 Check the help file for the Winlist() function. You can then iterate through the results of the array, testing each window for the text you are looking for.
Klexen Posted June 6, 2007 Author Posted June 6, 2007 (edited) This is what I got, how do I get it to close if either is open? If I have it like this the program crashes. AdlibEnable("killchat") $killchat = "Chat" $killmyspace = "MySpace" while 1 sleep(1000) WEnd Func killchat() if WinExists("",$killchat) And WinExists("",$killmyspace) then winclose("",$killchat) and winclose("",$killmyspace) sleep(1000) EndFunc Edited June 6, 2007 by Klexen
Valuater Posted June 6, 2007 Posted June 6, 2007 Not tested AdlibEnable("killchat") $killchat = "Chat" $killmyspace = "MySpace" While 1 Sleep(1000) WEnd Func killchat() If WinExists("", $killchat) Then WinClose("", $killchat) If WinExists("", $killmyspace) Then WinClose("", $killmyspace) Sleep(1000) EndFunc ;==>killchat 8)
Klexen Posted June 6, 2007 Author Posted June 6, 2007 Not tested AdlibEnable("killchat") $killchat = "Chat" $killmyspace = "MySpace" While 1 Sleep(1000) WEnd Func killchat() If WinExists("", $killchat) Then WinClose("", $killchat) If WinExists("", $killmyspace) Then WinClose("", $killmyspace) Sleep(1000) EndFunc ;==>killchat 8) I could have sworn I tried that before. I think when I did that Igoogled the word "chat" and since it wasnt Chat it didn't work, so I thought I did something wrong. Thanks a lot Valuater. I noticed it doesn't read the words chat in a webpage such as this form. Is it possible to do that with the WinExists or similar command? CODE AdlibEnable("killchat") $killchat = "Chat" $killmyspace = "MySpace" $killchat2 = "chat" While 1 Sleep(1000) WEnd Func killchat() If WinExists("", $killchat) Then WinClose("", $killchat) If WinExists("", $killchat2) Then WinClose("", $killchat2) If WinExists("", $killmyspace) Then WinClose("", $killmyspace) Sleep(1000) EndFunc ;==>killchat
Generator Posted June 6, 2007 Posted June 6, 2007 In help File WinTitleMatchMode Alters the method that is used to match window titles during search operations. 1 = Match the title from the start (default) 2 = Match any substring in the title 3 = Exact title match 4 = Advanced mode, see Window Titles & Text (Advanced) -1 to -4 = force lower case match according to other type of match.In autoit it would be Opt("WinTitleMatchMode",2)
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