Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
My script navigates and clicks the link - but I get a pop-up screen (see attached). I have tried all combinations of SendKeysTo, child.. for example SendKeysTo("Microsoft", "~") - but nada.
Any suggestions?
This code first of all makes a list of all parent windows, and allows you to choose one. Then it gets the list of all children of that parent for your perusal.
parents=WinItemize() thisone=AskItemList("Choose a Parent Window",parents,@tab,@sorted,@single) children=WinItemChild(thisone) child=AskItemList("Children of %thisone%",children,@tab,@sorted,@single)If its a parent window the code will probably look like this:
SendKeysTo("Microsoft Internet Explorer~","{ENTER}")If its a child window the code will probably look like this:
SendKeysChild("~Microsoft Internet Explorer","Microsoft Internet Explorer~","{ENTER}")Notice the use of tildes.
In the script I issue
oIE.Document.Body.GetElementsByTagName("A").Item(6).Click()which executes the Unregister Link, and pops-up the confirm dialog. However, at this point, the script is paused. I put in the code you suggested but it never executes until I manually address the pop-up dialog. I've also tried dropping my oIE Object, trying to set up oIE1 as a GetObject, and other why nots...
Run("a.wbt","") oIE.Document.Body.GetElementsByTagName("A").Item(6).Click()a.wbt
title = "Microsoft Internet Explorer~" If WinWaitExist(title, 10)then SendKeysTo(title,"{Tab}{ENTER}") exitOr try setting the onclick event to "", like this:
Winbatch Version: 2005C -- Script by Jay Alverson ; seemed to be a timing issue... ; anyway this seems to work and I get no CONFIRM and ; no 2nd script... #DefineSubRoutine startMSIE(url) Browser = ObjectOpen("InternetExplorer.Application") Browser.addressbar = @FALSE Browser.statusbar = @FALSE Browser.menubar = @FALSE Browser.toolbar = @FALSE browser.visible = @TRUE browser.navigate(url) ; wait until page loads... While Browser.busy || Browser.readystate <> 4 TimeDelay(0.5) EndWhile ; setup the document object... browserDoc = Browser.Document all = browserdoc.all Return(browser) #EndSubRoutine #DefineSubRoutine WaitForBrowser() While Browser.busy || Browser.readystate <> 4 TimeDelay(0.5) EndWhile Return #EndSubRoutine url = "www.money-4-living.com" br = startMSIE(url) browser.document.GetElementsByTagName("A").item(2).click WaitForBrowser() browser.document.GetElementsByTagName("A").item(6).onclick = "" browser.document.GetElementsByTagName("A").item(6).click WaitForBrowser() Exit
I also tested the onclick="" to the script and jsmith was history. I didn't realize you could ignore Jscript code like that - thanx again
Article ID: W17179
File Created: 2007:07:03:14:28:36
Last Updated: 2007:07:03:14:28:36