Open Internet Explorer if a window doesn't already exist.
Posted: 17 Feb 2018, 17:54
I have been trying to build a script that will open a new tab in IE, and go to a specific URL if an IE window is already open., and open an IE Window, if there isn't one open. The new tab if Open part works. But i cant get the other half to. I have gotten Notepad and such to work with similar scripts. But IE just isn't working. Here's the script i have so far.
All other aspects of the code are working correctly. But the opening of IE when i press the "Jason" Button, (my test button) its not opening a window. Please help.
Code: Select all
+#c::
Gui, 8: Show, w120 h170, CoachView
Gui, 8: Add, Text ,, Team Select
Gui, 8: Add, Button, g1, Jason
Gui, 8: Add, Button, g2, Wanda
Gui, 8: Add, Button, g3, CW
Gui, 8: Add, Edit, w50 vCustom hwndhCustom
Gui, 8: Add, Button, x65 y111 gCustom, Select
Return
Placeholder(hCustom, "Custom")
1:
SUP = jwf160
;MsgBox % SUP
ifWinExist ahk_exe iexplore.exe
{
WinActivate, ahk_exe iexplore.exe
WinWaitActive, ahk_exe iexplore.exe
SendPlay, ^t
SendPlay, http://google.com/%SUP% {Enter}
Return
}
Else
{
Run, "C:\Program Files\Internet Explorer\iexplore.exe"
WinWait ahk_exe iexplore.exe
;SendPlay, ^t
SendPlay, http://google.com/%SUP% {Enter}
}
Return
2: ;;(Similar)
3: ;;(Similar)
Custom:
;;(similar but with
;;Custom:
;;Gui, Submit, NoHide
;;SUP := Custom
;;IfWinExist, ahk_exe iexplore.exe
;;Send, ^t
;;Send, http://coachview.ftr.com/CoachView/?id=%SUP%
;;Return
8GuiClose:
Gui, 8:Destroy
Return