Open Internet Explorer if a window doesn't already exist.

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Open Internet Explorer if a window doesn't already exist.

Re: Open Internet Explorer if a window doesn't already exist.

by reboot689 » 23 Feb 2018, 14:53

Got it!

Code: Select all

1:
SUP = clw055

IfWinExist, ahk_exe iexplore.exe
	{
		If WinActive ahk_exe iexplore.exe
		{
			SendPlay, ^t
			Sleep, 25
			SendPlay, http://google.com/%SUP% {Enter}
			Return
		}
		Else
		{
			WinActivate, ahk_exe iexplore.exe
			SendPlay, ^t
			Sleep, 25
			SendPlay, http://google.com/%SUP% {Enter}
			Return
		}
	}
Else
	{
		Run, C:\Program Files\Internet Explorer\iexplore.exe http://google.com/%SUP%
		Return
	}
It seemed to have been an issue of Brackets and Dirty Code.

Open Internet Explorer if a window doesn't already exist.

by reboot689 » 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.

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
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.

Top