Sign in to follow this  
Followers 0
JacobA

IE Create vs. Gui Object

4 posts in this topic

#1 ·  Posted (edited)

I am starting to find some weird quirks in autoit as I come close to finishing my latest project. You can see some of my other concerns in the other threads I recently posted - some are getting close to being fixed however (I hope).

My latest one revolves around the following:

$get_article = Fileopen("Article_1.txt.",0)
            If $get_article = -1 Then
            MsgBox(0, "Error", "Unable to open content")
                Exit
            EndIf
        $t_body = FileRead($get_article)
        FileClose($get_article)
        
        
        $frame_list = _IEFrameGetCollection($oIE,0)
        $frame_nums = @extended
        MsgBox(0,"frames", $frame_nums)
        _IEDocWriteHTML($frame_list, $t_body)
        sleep(1000)
        
        $colTags_T = _IETagNameGetCollection($oIE, "input")
        for $sub in $colTags_T
            MsgBox(0, "submiter", $sub.value)
        if $sub.value =="Submit" Then
        ;MsgBox(0, "HERE", "HERE")
        _IEAction($sub,"focus")
        _IEAction($sub,"click")
        EndIf       
        Next

The problem here is the Submit button - not it NOT finding it, but the submit actually going through. It modifies the text of a TinyMCE frame on the IE page and then attempts to submit the content. If I run this function alone, after a simple _IECreate() method to get a spanking new window etc, it submits just fine - which $oIE is above.

However, if I take the same exact code, stick it inside a new function like _submit(), and reference an IE window (e.g. simply $oIE_4) within a GUI (so a GUI Object e.g. Global $GUIActiveX4 = GUICtrlCreateObj($oIE_4, 10, 40+75+260, 600-100, 300)) - and obviously change all $oIE's to $oIE_4's above - it correctly fills out the MCE, hits the submit button... and boom... the submit fails. It doesn't recognize that there is content inside the MCE. Is the embedded object being handled differently somehow than a purely created IE instance? I have no clue what is happening as the code is exactly the same - just one is targeting an object in a GUI, and the other not.

Can someone shed light on what might be going on here? It would be hard to paste my entire code as it's quite a large project, but I can add snippets if someone had an inkling of what might be happening. Please help! SOS! Cheers.

Edited by JacobA

Enjoy making solutions for points-2-shop

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Ive tried the function alone, with a pre-built .txt file in an iecreate() window and a GUI object... it only works with the former still - anyone have any thoughts?

THIS IS DRIVING ME MAD!

The docwrite HTML works perfectly fine in a new IE window. I have been following the change in the HTML with DebugBar. So... it should be exactly the same when I run the function in an IE object in a GUI... BUT NOOOOO it fails miserably... it's like it's changing other HTML... or the IE DOM (?) is getting tweaked? No clue.... SOS!

Edited by JacobA

Enjoy making solutions for points-2-shop

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Im begging :unsure: this is my last hurdle to finish this thing! I would prefer to work inside the GUI, rather than having to have to open a new IE window everytime the function is called...

I owe a beer to whoever figures this one out - or sends me on the right path.

Edited by JacobA

Enjoy making solutions for points-2-shop

Share this post


Link to post
Share on other sites

Nothing stands out in your code that would make things different with the GUI Object instead of a full window.

In any case, there have been issues with the GUI Object and IE and I can suggest you look at my sig for a pointer to an alternative to _IECreateEnbedded created by another forum member that has the appearance of an embedded objust, but in fact uses a full IE instance and has worked pretty flawlessly.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe 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

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0