' ' preview.vbs ' Version 2.0 by NaO ' ' Load and reload html file via Internet Explorer ' for Windows emacs html edit mode (epo, yahtml, ...) processor invocation ' ' Usage: WSCRIPT.EXE preview.vbs URL ' Ex: wscrpit preview.vbs c:/foo/bar.html ' url = "about:blank" If Wscript.Arguments.Count > 0 Then url = Wscript.Arguments(0) Set s = Wscript.CreateObject("Shell.Application") For Each a in s.Windows If InStr(a.FullName, "IEXPLORE.EXE") > 0 Then Navi a Wscript.Quit End If Next Set a = Wscript.CreateObject("InternetExplorer.Application") Navi a Sub Navi (a) If InStr(LCase(a.LocationURL), LCase(url)) Then a.Refresh Else a.Navigate url End If a.Visible = True End Sub