taylormade Posted September 21, 2012 Share Posted September 21, 2012 (edited) part of my script is: ------------------------------------------------------ If StringInStr(_IEBodyReadText($oIE), $Text, 2) = 0 and $a = 1 Then _IELinkClickByText($oIE, "Accept project") ; more code here Endif ------------------------------------------------------ What I'm doing is waiting for the page NOT to contain the text in $Text. Then it should procede to the next line: _IELinkClickByText($oIE, "Accept project") (click the button) However, there are occations when $Text is not present on the page, AND that button is NOT there either (ie: the page doesn't load fully, or a different page appears briefely) In that case, I want my script to exit the IF / Endif and just procede past it and continue the code. I want to run this in the Scite Editor for now, so I don't need any UI and such. Here is the error I'm getting when the scenario I illustrated above occurs. " Warning from function _IELinkClickByText " Can I trap that error and then get out of the IF / ENDIF section gracefully somehow? bob Edited September 21, 2012 by taylormade Link to comment Share on other sites More sharing options...
Blue_Drache Posted September 21, 2012 Share Posted September 21, 2012 (edited) Psudeocode noodling... While 1 Sleep(10) If _PageLoaded() Then If Not _SearchForText() Then _IELinkClickByText($oIE, "Accept project") If @error <> 0 then ConsoleWrite("Unable to locate click link by text. Error code: " & @error & @CRLF) EndIf EndIf WEnd This is what I got based on what you want to do. Also, what error code is it throwing? According to the help file, @error can be one of 8 values with different meanings. The conslewrite call will scribble it into the console on SciTE so you can see what's happening. Edited September 21, 2012 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
taylormade Posted September 21, 2012 Author Share Posted September 21, 2012 nice quick response..:I'm new to AutoIT so...Are: If _PageLoaded() Then If Not _SearchForText() Thensupposed to be in my code "as is" or do I need to put parameters to them._SearchForText seems to need more info right? Link to comment Share on other sites More sharing options...
Blue_Drache Posted September 21, 2012 Share Posted September 21, 2012 Psuedocode, dude. Not real code. That means I roughed out the structure and idea with simplified language. _pageloaded() and _searchfortext() are placeholders for whatever code you're going to use. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
taylormade Posted September 21, 2012 Author Share Posted September 21, 2012 if you have a Paypal account, I can shoot you a few bucks to fix my actual code with the real stuff? Link to comment Share on other sites More sharing options...
Blue_Drache Posted September 21, 2012 Share Posted September 21, 2012 No. We don't do that here. Our focus is to teach you how to do it ... not write it for you. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache 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