Last active
August 29, 2015 14:02
-
-
Save prashanthrajagopal/a81e0590a54491599456 to your computer and use it in GitHub Desktop.
Get the browser from URL for firefox and IE with auto it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if $CmdLine[0] >= 1 Then | |
$userInput = $CmdLine[1] | |
Else | |
$userInput = InputBox("GetURL", "Enter the bame of the browser", "firefox", "", "") | |
EndIf | |
if $userInput == "firefox" Then | |
$window = "[CLASS:MozillaWindowClass]" | |
if not winexists($window)=1 then; | |
MsgBox(0, "GetURL", "Mozilla Firefox is not running") | |
Else | |
WinActivate($window) | |
Send("^l") | |
Send("^c") | |
$url = ClipGet() | |
MsgBox(0, "URL", $url) | |
EndIf | |
ElseIf $userInput == "ie" Then | |
$window = "[CLASS:IEFrame]" | |
if not winexists($window)=1 then; | |
MsgBox(0, "GetURL", "Internet Explorer is not running") | |
Else | |
WinActivate($window) | |
$url = ControlGetText($window,'',"Edit1") | |
MsgBox(0, "URL", $url) | |
EndIf | |
Else | |
MsgBox(0, "GetURL", "Only IE and firefox are supported") | |
EndIf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment