/*
Usage:
/ie.navigate <url>
/ie.minimize
/ie.quit
Examples:
//ie.navigate
www.mirc.com | ie.minimize
//ie.navigate
www.winamp.com | .timer 1 5 ie.minimize | .timer 1 8 ie.quit
Note that you can use /ie.navigate <url> repeatedly once you've done it the first time. It will simply navigate to the new url specified. In other words, you don't need to /ie.quit if all you want to do is navigate to another page.
Note that once you have minimized the ie window, when navigating after that you don't have to call /ie.minimize anymore, it'll stay minimized until you manually maximize it or put it as active window.
This will always open an Internetexplorer window, even when your default browser is Mozilla firefox.
Just so you are clear on the matter, you can only use /ie.minimize and /ie.quit if you've previously opened a window with /ie.navigate. In other words, if you externally open a browser window, those commands will have no effect.
*/
alias ie.navigate {
var %tmp = $$1, %open = .comopen ie internetexplorer.application
if (!$com(ie)) %open
elseif (!$com(ie,visible,2)) { .comclose ie | %open }
if (!$com(ie).result) %tmp = $com(ie,visible,4,bool,true)
%tmp = $com(ie,navigate,1,bstr*,$1)
}
alias ie.minimize {
var %tmp = $$com(ie), %wsh = wsh $+ $ticks
%tmp = $com(ie,locationname,3)
.comopen %wsh wscript.shell
%tmp = $com(%wsh,appactivate,1,bstr*,$com(ie).result)
%tmp = $ticks + 200
while ($ticks < %tmp) !
.comclose %wsh $com(%wsh,sendkeys,1,bstr*,% n)
}
alias ie.quit {
if ($com(ie)) .comclose ie $com(ie,quit,1)
}
The ie.navigate alias is a bit ugly because if you would open a browser window with /ie.navigate, and then close it by clicking the "X" or pressing alt+f4, the object would remain open, but we would have lost control over it. This issue doesn't exist anymore now.
Btw does it really need to open an external browser window? Because you could have a browser window within your mIRC using
nHTMLn