Let's see a short JScript web automation macro that closes the first IE8 tab loaded from google.com domain. If the closing tab is the last tab inside the IE frame then the whole browser will be closed.
// Create core object.
var core = new ActiveXObject("Twebst.Core");
// Find a browser for which the displayed URL contains "google.com".
core.useRegExp = true;
var b = core.FindBrowser("url=.*google.com");
b.Close();
There are more Twebst methods for automating IE7 and IE8 tabs that I'll talk about in future articles: OpenNewTab, activeTab, isTabActive, tabList
No comments:
Post a Comment