program HeinekenReport; // sample script that will automate saving the currently loaded web page // including processing of the Save Web Page Popup dialog procedure OnDocumentComplete(URL : string); begin if IsPartOf('http://www.yahoo.com/', URL) then begin // simulates pressing the File->Save As on the browser SendKeyPress('ALT+F'); SendKeyPress('A'); // enter whatever filename you want SendStringToWindow('Save Web Page', 'MyFilename', 1000); // code below will save the web page by clicking the Save button // SendKeyPress('ALT+S'); end; end; begin // this will always execute on IE browser SetExecuteBrowser('IE'); Navigate('http://www.yahoo.com/'); end.