DarkOnyx Posted December 4, 2015 Share Posted December 4, 2015 (edited) Hi Folks, I was wondering if someone could give me a hand with something. Perhaps I am misunderstanding something. I am trying to do a login window multiple times in IE. I am using the IEEx.au3 library and it looks something like this: -----------------------------------------------------------------------------------------------------------------expandcollapse popup#include <IE.au3> #include <IEEx.au3> Global $oIE = _IECreate("https://somewebsitehere", 1) Local $username = _IEGetObjByName ($oIE, "username") Local $password = _IEGetObjByName ($oIE, "password") Local $button = _IEGetObjByName ($oIE, "login") _IEFormElementSetValue ($username,"whatever username") _IEFormElementSetValue ($password,"whatever password") _IEAction ($button, "click") Global $goTab = _ExampleTabCreate($oIE) ConsoleWrite(@error & ":" & @extended & ": IsObj = " & IsObj($goTab) & @CRLF) _IEQuit($goIE) Func _ExampleTabCreate(ByRef $oObj) ; THIS IS WHAT IS CAUSING THE TROUBLE!!! If Not IsObj($oObj) Then Return SetError(1, 0, 0) EndIf ; Second website Local $oTab = _IEEx_TabCreate($oObj, "https://somewebsitehere") Local $username = _IEGetObjByName ($oTab, "username") Local $password = _IEGetObjByName ($oTab, "password") Local $button = _IEGetObjByName ($oTab, "login") _IEFormElementSetValue ($username,"whatever username") _IEFormElementSetValue ($password,"whatever password") _IEAction ($button, "click")------------------------------------------------------------------------------------------------------So this works, but I have two main problems.Most importantly, I want to use this in a function. The problem is, that line "Func _ExampleTabCreate(ByRef $oObj) " prevents that from happening. SciTe essentially thinks that I am defining a function inside of defining a function and it yells at me. It won't run without it.Secondly, that IEAction "click" never worked for me. It will propogate the fields correctly based on the name in the source... it just won't submit the form.Any ideas here? Edited December 4, 2015 by JLogan3o13 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 4, 2015 Moderators Share Posted December 4, 2015 (edited) @DarkOnyx, you are specifying Func _ExampleTabCreate(), but I see no EndFunc to close it out. Also, in the future, please place your code inside a code box, it makes it so much easier to read. Edited December 4, 2015 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
DarkOnyx Posted December 5, 2015 Author Share Posted December 5, 2015 Sure thing. And thanks for the response.The problem is, it still doesn't work when I use and endfunc. It works fine as written for some reason. Very bizarre. I think that the formatting doesn't work for some reason.I think that defining a function inside of defining a function is what trips it up. It doesn't seem to like this format:Func Dosomestuff() Func Dootherstuff() Endfunc Endfunc Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted December 5, 2015 Moderators Share Posted December 5, 2015 You are correct that AutoIt does not allow for nested functions. I only see the one function you reference, however. Can you please post the entirety of you code so we can see what you're trying to do? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! 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