Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wait for page to open

Status
Not open for further replies.

iStruggle

Technical User
Jan 22, 2009
2
US
I am building a WScript to open IE7 and open two tabs.

However, I want to wait until the first page opens, then enter username/password hit {enter}, wait for that page to open in the same tab, THEN open the second tab with the second page.

The error I get is "Expected ';'" on Line 3, Char 5. I don't see it.

I probably have errors further in the code as well. I am just using notepad for editing. I don't have a js editor.

Yes. I am new to code...well haven't touched it for 18 years. I am new to this site but use very frequently.

Code:
var navOpenInBackgroundTab = 0x1000;
var oIE = new ActiveXObject("InternetExplorer.Application");
Dim objShell
Set objShell = CreateObject("WScript.Shell")


oIE.Navigate2("[URL unfurl="true"]https://mail.google.com/a/mycompany.com/");[/URL]
oIE.Visible = true;

Do Until oIE.ReadyState = 4;
Wscript.Sleep 100;
Loop;

objShell.SendKeys "username";
objShell.SendKeys "{TAB}";
Wscript.Sleep 100;
objShell.SendKeys "password";
objShell.SendKeys "{ENTER}";

Do Until oIE.ReadyState = 4;
Wscript.Sleep 100;
Loop;

oIE.Navigate2("[URL unfurl="true"]https://calendar.google.com/a/mycompany.com/",[/URL] navOpenInBackgroundTab);
 
You're mixing javascript and vbscript !

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top