I came across HTA (HTML Applications) a while ago and I have to say it’s kinda neat.
In a way it’s not a big deal, but I didn’t know you could do this, and it really empowers you to write neat little apps fast by using JScript or VBScript and HTML, which is basic knowledge for a web developer right?
You can already write small apps in plain HTML pages, that’s right, but now and then you run into the problem that you need to do something your browser won’t let you because of security restrictions, and it’s damned right not to let you! For instance you’re trying to access an XML file on your hard drive. No biggy, but you won’t allow anyone to access your file system now will you?
How it works is that your newly created HTA page is running inside a seperate instance of Internet Explorer, with all those typical security restrictions turned off as your running it as a trusted application now. So you’re free to create any available ActiveX objects to do all sort of stuff like accessing the file system (FileSystemObject), parse XML files (MSXML2), access remote web pages (XMLHTTP), run stuff in shell commands (WShShell), you name it.
Another cool thing with these HTA pages is that it even supports command line parameters. So you can write one and launch it from a command shell, with a few command line options, to do some funky shiznit for you.
“Ok”, you say, “This is neat, but can’t I just write a simple .JS or .VBS script if I want to use command line stuff anyway?” Well yes you could, but there’s one advantage to the HTA approach, and that’s the fact that you can include other scripts using the HTML script tag, so you can finally create some handy libraries to do the mundane stuff for you.
There’s no way to do that in a plain .js or .vbs script, which sucks IMO, since after you’ve written a few of those, you realise you keep needing the same kind of functionality over and over again, which would be ideal to put in a library… which you can’t include… so you copy paste… blegh…
But anyway, if you feel like slapping together a quick app maybe give this HTA thing a shot. You might dig it.