Jump to content

Recommended Posts

Guest Lor20
Posted (edited)

ok this works now :-) but i got a different problem now...

#include <File.au3>
Opt ("WinTitleMatchMode", 2)
Opt ("WinDetectHiddenText", 1)
$URLLIST = FileOpenDialog("where is your URL-list?", "c:/", "Text Files (*.txt)", 1)
$LINES = _FileCountLines ($URLLIST)
$IE = "C:\Programme\Internet Explorer\Iexplore.exe"
$SPACE = " "
$I = 1
Dim $LINK[$LINES + 10]
Dim $HANDLE[$LINES + 10]
Dim $RESULT[$LINES + 10]
While $I < 6
   $LINK[$I] = FileReadLine($URLLIST, $I)
   Run($IE & $SPACE & $LINK[$I], "", @SW_MINIMIZE)
   $I = $I + 1
Wend
Sleep(5000)
$K = 1
Do 
   Opt ("WinTitleMatchMode", 2)
   $HANDLE[$K] = WinGetHandle("", $LINK[$K])
   $K = $K + 1
Until $K = 6
$I = 1
$J = 6
While $I <= $LINES
   Opt ("WinTitleMatchMode", 4)
   WinSetState("handle=" & $HANDLE[$I], "", @SW_MAXIMIZE)
   $TIME = 0
   do
      Sleep(10)
      $TIME = $TIME + 10
      If StringInStr(StatusbarGetText("handle=" & $HANDLE[$I], "", 1), "nextsite here") > 0 Then $time=0
      If StringInStr(StatusbarGetText("handle=" & $HANDLE[$I], "", 1), "nextsite here") > 0 Then ExitLoop
   Until $time=5000
   $RESULT[$I] = 1
   If $J <= $LINES Then $LINK[$J] = FileReadLine($URLLIST, $J)
   If $J <= $LINES Then Run($IE & $SPACE & $LINK[$J], "", @SW_MINIMIZE)
   Opt ("WinTitleMatchMode", 2)
   If $J > 7 Then If $J <=  ($LINES + 2) Then $HANDLE[$J - 2] = WinGetHandle("", $LINK[$J - 2])
   Opt ("WinTitleMatchMode", 4)
   For $ACTUAL = 0 To $I
      Opt ("WinTitleMatchMode", 4)
      If StatusbarGetText("handle=" & $HANDLE[$I - $ACTUAL], "", 1) = "Done" Then If $RESULT[$I - $ACTUAL] = 1 Then WinClose( "handle=" & $HANDLE[$I - $ACTUAL], "")
   Next
   $I = $I + 1
   $J = $J + 1
Wend
Sleep(3000)
For $CLOSE = 1 To $LINES 
   WinClose("handle=" & $HANDLE[$CLOSE], "")
Next

Somehow it appears to trigger the until $time=5000 event every 5 seconds instead of every 5 seconds after a page has started. that also causes the windows that are triggered like this to not get a correct handle and therefor not to get closed. Frankly i have no idea why that would be.

Lor20

Edited by Lor20

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...