Jump to content

Open New Ie tab/ Look for open instance


Recommended Posts

OK I have a script that I have that opens a new instance of IE and browses to a particular website. What i want to do is have it look for an open instance of IE and if open then just create a new tab and proceed if necessary but if IE isn't open then just go ahead and open up the instance and proceed as needed.

Thanks

#include <IE.au3>
$number = InputBox("CRM Login Information", "Please Enter Your Vdshosting Username Only", "")
$number1 = InputBox("CRM Login Information", "Please Enter Your Password", "")
SplashTextOn("CRM Information", "This will Block Keyboard Input and Mouse")
Sleep(3000)
SplashOff()

BlockInput(1)
; Check the user's answer to the prompt (see the help file for MsgBox return values)
Run("C:\Program Files\Internet Explorer\iexplore.exe", "", @SW_MAXIMIZE)
WinWaitActive("Yahoo! - Windows Internet Explorer")
MouseMove(155, 42)
MouseClick("Left")
Sleep(500)
Send("{Backspace}")
Sleep(500)
Send("http://companywebsite.com")
Send("{Enter}")
WinWaitActive("Connect to crm..company.net")
Send("domain\")
Send($number)
Send("{Tab}")
Send($number1)
Send("{Enter}")
Sleep(8000)
MouseMove(42, 484)
MouseClick("Left")
Sleep(1000)
MouseMove(1025, 279)
MouseClick("Left")
Sleep(1000)
MouseMove(1019, 407)
MouseClick("Left")
BlockInput(0)
Exit
Link to comment
Share on other sites

You should take a look at the _IE functions, they should be alot better then mouseclicks and key sends:

$var=_IECreate()  ; create function has the option to attach to an existing window i think
$hIE = _IEPropertyGet($var, "hwnd")
WinSetState($hIE, "", @SW_MAXIMIZE)   ;maximize

_IENavigate()  ;navigate to url
_IEGetObjByName()
_IEAction()
.
..
...

Look at the helpfile (F1)

Edited by darkmaster071
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...