Jump to content

Creating and recognizing IE windows in a while function


TmanMrT
 Share

Recommended Posts

I'm need a portion of code that will create a certain given amount of windows (2 in this example) without waiting for them to load, and then wait for each one to load individually. With this code, it should go like this:

Create $ie1, no load wait

Create $ie2, no load wait

LoadWait($ie1)

LoadWait($ie2)

But for some reason, it doesn't want to recognize the _IELoadWait(Eval("ie" & $n)) at all. I've tried making the "$n" into a string after finding its value... but nothing seems to work. What am i doing wrong? :P

I included my code in case you're a little confused about what i'm trying to do:

CODE
#include <IE.au3>

Global $home = "https://iiod.ssts.com/login.asp?stname=Arizona&disname=Chandler&code=80&selschool=223&submit1=Submit"

Global $windows = 2

$n = 1

While $n < Number($windows+1)

Assign(String("ie" & $n), _IECreate($home, 0, 1, 0), 1)

$n+=1

WEnd

$n = 1

While $n < Number($windows+1)

_IELoadWait(Eval("ie" & $n))

$n+=1

WEnd

Link to comment
Share on other sites

Try this:

$n = 1
While $n < Number($windows+1)
    Assign(String("$ie" & $n), _IECreate($home, 0, 1, 0), 1)
    $n+=1
WEnd

$n = 1
While $n < Number($windows+1)
    $oTmp = Eval("$ie" & $n)
    _IELoadWait($oTmp)
$n+=1
WEnd

Dale

P.S. Nahuel's suggestion is a good one

Edited by DaleHohm

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

Link to comment
Share on other sites

Try this:

$n = 1
While $n < Number($windows+1)
    Assign(String("$ie" & $n), _IECreate($home, 0, 1, 0), 1)
    $n+=1
WEnd

$n = 1
While $n < Number($windows+1)
    $oTmp = Eval("$ie" & $n)
    _IELoadWait($oTmp)
$n+=1
WEnd

Dale

P.S. Nahuel's suggestion is a good one

oh! very good idea. that will probably work. :P

thank you!

i hadn't considered the fact that you might not be able to evaluate those kinds of things directly. :)

and i might consider arryays too ;)

Link to comment
Share on other sites

The _IE functions pass objects byRef, so the parameter cannot be an expression. Also note I changed your "ie" to "$ie" in two places.

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...