NB – this works for IE only. See comments in the code. 

First create an html file called close_window.html and put it in your htdocs area:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//E” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<link rel=”stylesheet” href=”docs/iamsdev.css” />
<Title>Close parent window after waiting</Title>
</head>
<body>
<script language=”javascript”>
var doneTimer = 0 ;
function myMess( mesg )
{
  document.writeln(“<br />” + mesg ) ;
}
function close_window(){
  myMess(“Attempting to close”);
  doneTimer = 1 ;
  window.opener.opener=‘x’; // IE only FF/NS don’t like this, but it stops the prompt to close the window appearing

  window.opener.close();
  window.close();
}
function do_close_wait(){
  myMess(“calling timer”);
  setTimeout(“close_window()”, 5000);
}
do_close_wait();
</script>
Waiting to close window
</body>
</html>

Then, in the post-form trigger put this:

web.show_document(‘/close_window.html’,‘_new’);

This spawns a child window. The close window code will wait 5 seconds and close its parent window and then itself. If anyone has time to get this working with FF please tell me how you did it.