Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

WinWait problem?

$
0
0
Hi all, i have a weird problem, i have made a script that waits for a window to popup before continue, it works as a standalone but not inside the bigger script and i can´t figure out why.
Here´s the standalone script:

WinWait("Kampanj -- Webpage Dialog", "")
	If WinExists("Kampanj -- Webpage Dialog", "") Then
   MsgBox(0,"KAMPANJ!","Kampanjfönster öppet")
   WinActivate("Kampanj -- Webpage Dialog", "")
   Send("{ALTDOWN}s")
   Sleep(100)
   Send("{ALTUP}")
   Sleep(100)
   Send("{ALTDOWN}t")
   Sleep(100)
   Send("{ALTUP}")
   Sleep(100)
   EndIf


And here´s the bigger script where this code just waits forever when it gets to the winwait:

#include <IE.au3>
#include <File.au3>
#include <Misc.au3>
#include <Excel.au3>
$g_szVersion = "blob"
If WinExists($g_szVersion) Then Exit ; do NOT run me again!
AutoItWinSetTitle($g_szVersion)
Global $kampanj
Global $rownr
Global $oIE
Global $oFrame
Global $ClipboardData
$rownr = 1
$oIE = _IEAttach("GSM-AHS")
WinActivate("GSM")
Sleep(50)
$kampanj = "KAM02370"
$oIE.document.all.data.contentwindow.document.forms.CampaignForm.LIST.value = $kampanj
Sleep(5000)
$oFrame = _IEFrameGetCollection($oIE, 2)
$ClipboardData = _IEPropertyGet($oFrame, "outerhtml")
If StringInStr($ClipboardData, "selected value=KAM02370") Then
$oIE.document.all.data.contentwindow.document.forms.CampaignForm.AddButton.disabled = False
sleep(1000)
$oIE.document.all.data.contentwindow.document.forms.CampaignForm.AddButton.click
EndIf

WinWait("Kampanj -- Webpage Dialog", "")
	If WinExists("Kampanj -- Webpage Dialog", "") Then
   ;MsgBox(0,"KAMPANJ!","Kampanjfönster öppet")
   WinActivate("Kampanj -- Webpage Dialog", "")
   Send("{ALTDOWN}s")
   Sleep(100)
   Send("{ALTUP}")
   Sleep(100)
   Send("{ALTDOWN}t")
   Sleep(100)
   Send("{ALTUP}")
   Sleep(100)
   EndIf


Im planning on using it with various diffrent webapplications and local server programs and files, that´s why all thoose includes
any thoughts?

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>