Jump to content

Recommended Posts

Posted (edited)

Can anyone explain why this loop fails on the second loop?

I have just updated the code, but still it does not loop

#include <IE.au3>

Opt("WinTitleMatchMode", 2)  

$pages = "0-9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"
$delim = ","

$URLsyntax1 = "http://emu-russia.km.ru/default.php?a=roms&sid=gen&from="
$URLsyntax2 = "&l=en"

$romPage = StringSplit($pages, $delim)

$oIE = _IECreate("about:blank")

For $i = 1 To $romPage[0] Step 1
    _IENavigate($oIE, $URLsyntax1 & $romPage[$i] & $URLsyntax2)
    
    $oTable = _IETableGetCollection($oIE, 6)

    $aTableData = _IETableWriteToArray($oTable)

    $numRomsOnPage = UBound($aTableData, 2) - 2
    
    For $j = 1 To $numRomsOnPage Step 1
        $title1 = "File Download"
        $title2 = "Save As"
        $title3 = "Completed"
        
        Sleep(3000)
        
        _IELinkClickByText($oIE, $aTableData[0][$j])    
                
        WinWaitActive($title1)
        
        MsgBox(0, "", "Active", 2)
        
        Sleep(3000)
                        
        Send("!s")

        WinWaitActive($title2)
        
        Send("{HOME}")
        
        Send("E:\j\ROMS\sega\" & $romPage[$i] & "\")
        
        Send("{ENTER}")
        
        WinWaitActive($title3)
        
        $handle = WinGetHandle($title3)
        
        WinWaitClose($handle)
    Next
Next

The "open, save as, cancel" dialog box stays active on the secon loop??

OS -Win XP Pro

IE 6

Thanks

Edited by creeping
Posted (edited)

which loop

Next

    ExitLoop
Next

with that code it will never do the second

For $i = 1 To $romPage[0] Step 1

loop

8)

EDIT...

also if it is a "save as" *file* dialog box

then

Send("E:\j\ROMS\sega\" & $romPage[$i] & "\")

is a folder not a file

Edited by Valuater

NEWHeader1.png

Posted (edited)

The first loop executes exactly as expected, but still wait at the same window. The file name is already filled out. When i press the {HOME} key it just inserts the path in from of the file name

Edited by creeping

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
×
×
  • Create New...