program GetActiveIEWindow; // This sample script continues script execution when a web page // launches a new IE window. The script resumes execution on the // new IE window. Use GetActiveBrowserWindow(); // New APIs supported in Newbie ver2.2l or later procedure OnDocumentComplete(URL : string); begin if URL = 'http://www.newbielabs.com/clam.html' then begin // hyperlink below launches a new IE window ClickHyperLink('ClamWin Home Page'); GetActiveBrowserWindow; end; if URL = 'http://www.clamwin.com/' then begin ClickHyperLink('About ClamWin Free Antivirus'); // execution is now on new browser NewbieScriptEnd; end; end; begin SetExecuteBrowser('IE', ''); Navigate('http://www.newbielabs.com/clam.html'); end.