KeeFy 0 Posted August 16, 2010 I've been working on this personal project of mine and have come to a brick wall that i've been unable to find the answer for. Essentially i'm able to click on the link <a class="bookingsButton" href="javascript:checkAutomaticBook('/members/bookings/open/event.book.form.action.xsp', 1500039744, 1500039764, 4 )">Book <br /> 08:32 AM</a> </div> This is part of the code that i'm having problem with. $sMyString = "08:32" $oLinks = _IELinkGetCollection($oIE) For $oLink in $oLinks $sLinkText = _IEPropertyGet($oLink, "innerText") If StringInStr($sLinkText, $sMyString) Then _IEAction($oLink, "click") WinActivate("Windows Internet Explorer") sleep(1000) Send("{ENTER}") ExitLoop EndIf Next MsgBox(0,"Finished","Finished",1) After the _IEAction($oLink, "click") the program comes to a halt state. After the clicking of the link a dialog popup box appears. The autoit Window Info summary shows the following code from the popup window. expandcollapse popup>>>> Window <<<< Title: Windows Internet Explorer Class: #32770 Position: 2747, 476 Size: 272, 185 Style: 0x94C801C5 ExStyle: 0x00010101 Handle: 0x01270BD8 >>>> Control <<<< Class: Button Instance: 1 ClassnameNN: Button1 Name: Advanced (Class): [CLASS:Button; INSTANCE:1] ID: 1 Text: OK Position: 56, 119 Size: 75, 23 ControlClick Coords: 45, 11 Style: 0x50030000 ExStyle: 0x00000004 Handle: 0x010D0C34 >>>> Mouse <<<< Position: 2851, 635 Cursor ID: 0 Color: 0xEFEFEF >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< OK Cancel Do you want to automatically book? >>>> Hidden Text <<<< I'm trying to just click the OK button, but the program halts and the IE window minimises. It frezzes until i personally give focus to the window and click the OK button and it'll complete and show the msgbox that it has completed. I've tried multiple ways but always end up getting a minimized window and frozen program after _IEAction($oLink, "click"). Any ideas? Thanks in advance! Keith Share this post Link to post Share on other sites
Bert 1,430 Posted August 16, 2010 Winlist then use that to use winactivate The Vollatran project My blog: http://www.vollysinterestingshit.com/ Share this post Link to post Share on other sites
KeeFy 0 Posted August 16, 2010 Winlist then use that to use winactivate It's not an elegant method but i've used a different script in a different file in order to gain focus and click it. $Clicked = 0 While $Clicked = 0 If WinExists("Windows Internet Explorer","Do you want to automatically book?") Then WinActivate("Windows Internet Explorer","Do you want to automatically book?") Send("{ENTER}") $Clicked = 1 MsgBox(0,"Booked","Success!",2) EndIf sleep(500) WEnd Slotting in a fucntion after the "_IEAction($oLink, "click") " code doesn't work no matter what. It goes into a pause state and i would love to have everything in one script. :/ I've tried all the few other methods that i was trying to use to click the ok button and it works as a different script running in the background. So essentially i guess my question is how do i get the main script to stop pausing @ _IEAction($oLink, "click") ?? Any insights would be nice! Thanks people! Share this post Link to post Share on other sites
DaleHohm 65 Posted August 16, 2010 Please see the second example for _IEAction in the helpfile. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object modelAutomate input type=file (Related)Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better?IE.au3 issues with Vista - WorkaroundsSciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Share this post Link to post Share on other sites
KeeFy 0 Posted August 22, 2010 Please see the second example for _IEAction in the helpfile.DaleThank you! I can't believe i missed it when i was reading the example for _IEAction. DOH! Share this post Link to post Share on other sites