Page 1 of 1

COM AHK HELP!

Posted: 19 Oct 2018, 00:34
by vergas78
I'm making a script using AHK to see if an address exists through the USPS website, since I'm automating the form login with COM i'm using wb.Document.getElementById("id").value:="input" , the thing is that when I run the script it only runs this line of code the first time it sees it and it doesn't run the second time any ideas on how to fix this?
Here's my code:
Address = Address
APT = Aptnumber
URL:="https://tools.usps.com/zip-code-lookup.htm?byaddress"
ComObjError(0)
WB := ComObjCreate("InternetExplorer.Application")
WB.Visible := True
WB.Navigate(URL)
While wb.readyState !=4 || wb.document.readyState !="complete" wb.busy ;page loading
wb.Document.getElementById("tApt").value:= Address
return
wb.Document.getElementById("tAddress").value:= APT
return
While wb.readyState !=4 || wb.document.readyState !="complete" wb.busy ;page loading
Sleep,10
return
ComObjError(1)