Using COM to login to different websites in IE in different tabs

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
scrivock
Posts: 1
Joined: 12 Dec 2017, 16:00

Using COM to login to different websites in IE in different tabs

12 Dec 2017, 16:20

Hello Everyone,

So, I am trying to use a script that will open IE, navigate to a certain website, log into that website, open a new tab, navigate to another website, log into that one, and so on. 5 websites total. I would rather just hit alt+space in the morning than login to each one. However I am at kind of a wall. I have the first two websites in the following script. It opens and logs into the first one fine. Then it opens the second website in a new tab, but doesn't log in. I've been searching the forums for a few hours now, but no matter what I have tried, it doesn't get me closer. Any suggestions would be greatly appreciated.

!space::

NoraLoginname = noraUN
NoraPassword = noraPW
NORA = http://www.norainfo.com/

WB := ComObjCreate("InternetExplorer.Application")
WB.Visible := True
WB.Navigate(NORA)
While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy ; wait for the page to load
Sleep, 10
wb.document.getElementById("MainContent_HeadLoginView_LoginUser_UserName").value := NoraLoginname
wb.document.getElementById("MainContent_HeadLoginView_LoginUser_Password").value := NoraPassword
wb.document.getElementById("MainContent_HeadLoginView_LoginUser_LoginButton").click()
While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy ; wait for the page to load
Sleep, 10

SimkarLoginname = simkarUN
SimkarPassword = simkarPW
SIMKAR = http://reps.simkar.com/
navOpenInNewTab = 2048

WB.Navigate(SIMKAR, navOpenInNewTab)
While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy ; wait for the page to load
Sleep, 10
wb.document.getElementById("username").value := SimkarLoginname
wb.document.getElementById("password").value := SimkarPassword
wb.document.getElementById("sbtn").click()
While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy ; wait for the page to load
Sleep, 10

Return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Joey5, mikeyww, RandomBoy, wpulford and 385 guests