Wednesday, October 28, 2009

Scripts Everywhere, and not an App to Run

In another entry of my series on my novice attempt at programming, I will be talking about Vbscript. When looking for references and tutorials you will inevitably locate guides for internet related VBscript, while my need at the moment is decidedly system based.

Lucky for me I know enough about VBscript to get me started. I was able to create an executable Vbscript file that didn't crash or exit. It maintained a healthy non-invasive loop that did exactly what I needed it to do. Once I had that little issue out of the way, which I might say was no small feat, I moved onto my arch nemesis; Internet Explorer.

So now I have this working VBscript that handles the system side requirements, but I still need it to reach out an touch an active IE window. Once I discovered the way to get the collection of shell windows it was pretty easy to start running head on into the brick wall of IE.

I spent most of my day trying to get a stupid onclick event working. Of course you can't just add it as a damn attribute, which it is; you have you use a special method to add the onclick event, which of course isn't supported by Microsoft's own webcontrol. Great! I finally just had to inject some Javascript into the damn document to add the event.

What I learned is that Microsoft can't handle a process from its own method, you have to use a third-party solution. Microsoft continues to amaze me, and don't even get me fucking started on the cross-frame scripting issue. Why I can't access an Iframe that in IE from my own damn machine is beyond me.