mikezwet2 Posted October 26, 2006 Share Posted October 26, 2006 (edited) Hello,Sometimes a message is posible when there is no search result in IE. My script have te click this message away and do something else.Problem is i dont know how to put this message in a if formule.If MsgBox ( 0, "Microsoft Internet Explorer", "") = 0 Then ;this line <<<< Send("{ENTER}") Send("{TAB 5}") Send("{ENTER}") AutoItSetOption ("WinTitleMatchMode", 2) WinClose("Microsoft Internet Explorer", "") Else Send("{TAB}") Send("{ENTER}") Sleep ( 250 ) Send("{TAB}") Sleep ( 250 ) Send("{ENTER}") Sleep ( 250 ) Send ("^a") Sleep ( 250 ) Send ("^c") AutoItSetOption ("WinTitleMatchMode", 1) WinClose("Nieuw bericht", "") AutoItSetOption ("WinTitleMatchMode", 2) WinClose("Microsoft Internet Explorer", "") EndIfHope you experts can help me.btw i found out its hard for a rookie to learn the code and combinations of it Edited October 26, 2006 by mikezwet2 Zwetsloot Kunststof Kozijnen Fabriek and Mike Zwetsloot Link to comment Share on other sites More sharing options...
Developers Jos Posted October 26, 2006 Developers Share Posted October 26, 2006 btw i found out its hard for a rookie to learn the code and combinations of it Kozijnen is gemakkelijker ? Anyway, maybe you need to explain a bit more about what you exactly want to do.I see in your code that YOU display a MsgBox() But you test for 0 which should never be retuned.WinWait() waits for a particular window title/text comboWinExists(0 check if a window exists with the Title/text comboIs that what you are looking for ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
mikezwet2 Posted October 26, 2006 Author Share Posted October 26, 2006 (edited) Kozijnen is gemakkelijker ? Anyway, maybe you need to explain a bit more about what you exactly want to do.I see in your code that YOU display a MsgBox() But you test for 0 which should never be retuned.WinWait() waits for a particular window title/text comboWinExists(0 check if a window exists with the Title/text comboIs that what you are looking for ?Winwait and WinExits could be ok but the script not only has to wait and click the message, it also have to do something when its not appear and something if it appear.Oke step by step.Search in IEType search stringPress search buttonIf message "Nothing found" appearsclick OKClick cancel searchClose IE windowElseGo on with te script....Hope its clear what is have to do with te message that could be appear sometimes. Edited October 26, 2006 by mikezwet2 Zwetsloot Kunststof Kozijnen Fabriek and Mike Zwetsloot Link to comment Share on other sites More sharing options...
Developers Jos Posted October 26, 2006 Developers Share Posted October 26, 2006 (edited) Winwait and WinExits could be ok but the script not only has to wait and click the message, it also have to do something when its not appear and something if it appear.Oke step by step.Search in IEType search stringPress search buttonIf message "Nothing found" appearsclick OKClick cancel searchClose IE windowElseGo on with te script....Hope its clear what is have to do with te message that could be appear sometimes.With "Search in IE" you mean : Activate IE window and type Ctrl+F, type the search argument in the Find Window and click "Find Next". Then wait for the Not Found window else move on ? Edited October 26, 2006 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
GaryFrost Posted October 26, 2006 Share Posted October 26, 2006 sounds like a job for AdlibEnable in case that window shows up. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
mikezwet2 Posted October 26, 2006 Author Share Posted October 26, 2006 With "Search in IE" you mean : Activate IE window and type Ctrl+F, type the search argument in the Find Window and click "Find Next". Then wait for the Not Found window else move on ?Yeah Thats right! Zwetsloot Kunststof Kozijnen Fabriek and Mike Zwetsloot Link to comment Share on other sites More sharing options...
mikezwet2 Posted October 27, 2006 Author Share Posted October 27, 2006 I hope its not a crime to put this topic in attention on top of the list Zwetsloot Kunststof Kozijnen Fabriek and Mike Zwetsloot Link to comment Share on other sites More sharing options...
Developers Jos Posted October 27, 2006 Developers Share Posted October 27, 2006 Maybe something like this to get you started: expandcollapse popup; Start Search $SearchText = "Kozijn" AutoItSetOption ("WinTitleMatchMode", 2) ; Close find window whe exists If WinExists("Find","") Then WinActivate("Find","") Send("{Esc}") EndIf WinActivate("Microsoft Internet Explorer","") WinWaitActive("Microsoft Internet Explorer","") Sleep(1000) ;Send("^F") Send("!EF") WinWait("Find","") ; Specify Search text and enter Send($SearchText & "{Enter}") ; Loop till not found While 1 ; Give time to find it Sleep(500) If WinExists("Microsoft Internet Explorer","Finished searching the document.") Then MsgBox(0,"Not Found","Not Found") ExitLoop EndIf MsgBox(0,"Found","Found") ;Do what needs to be done when found ; ; ; ; Activate Find window WinActivate("Find","") ; Find Next Send("{Enter}") WEnd ; Close find window If WinExists("Microsoft Internet Explorer","Finished searching the document.") Then WinActivate("Microsoft Internet Explorer","Finished searching the document.") Sleep(200) Send("{Enter}") EndIf If WinExists("Find","") Then WinActivate("Find","") Sleep(200) Send("{Esc}") EndIf SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
mikezwet2 Posted October 29, 2006 Author Share Posted October 29, 2006 (edited) Maybe something like this to get you started: Thanks JdeB. I still figure it out. Whole script works only the part down here is not working. The not found message is not clicked away Because of that, the script dont choose the right desision... Opt("TrayIconDebug", 1); Curser on systray icon will give current script line. #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep ( 250 ) If _IsPressed("31", $dll) Then Sleep ( 250 ) While 1 If WinExits("Microsoft Internet Explorer","Het doorzoeken van het document is voltooit") Then Sleep ( 250 ) Send("{ENTER}") WinClose("Microsoft Internet Explorer","Het doorzoeken van het document is voltooit") else WinActivate("FileMaker Developer", "") WinWaitActive("FileMaker Developer") EndIf WEnd EndIf WEnd DllClose($dll) Not found message: Not found message AutoIt info: Edited October 29, 2006 by mikezwet2 Zwetsloot Kunststof Kozijnen Fabriek and Mike Zwetsloot Link to comment Share on other sites More sharing options...
Developers Jos Posted October 29, 2006 Developers Share Posted October 29, 2006 (edited) Mike, misschien is voltooid verkeerd gespeld in je Win???? Functies ? De Window Title/Text moet exact zijn!In mijn voorbeeld doe ik een Enter omdat het niet een standaard Window is met standaard Controls. Edited October 29, 2006 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
mikezwet2 Posted October 29, 2006 Author Share Posted October 29, 2006 Mike, misschien is voltooid verkeerd gespeld in je Win???? Functies ? De Window Title/Text moet exact zijn!In mijn voorbeeld doe ik een Enter omdat het niet een standaard Window is met standaard Controls.Damn, dump blond mike Script works great now Thanks for help!!Is is possible to run a script in the background, witout you see the steps ? Zwetsloot Kunststof Kozijnen Fabriek and Mike Zwetsloot 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