On 16 Sep 2013, at 0:01, Stephen Bannasch wrote:
[…] Can you point me to an existing bundle which uses window.close() ... or an example of how to use it?
A command with HTML output can execute something like:
print '<a href="#" onClick="javascript:window.close(); return true;">close</a>'
That would generate a link to close the window (effectively an alias for ⌘W).
I’m not sure any commands actually use it. An example could be the LaTeX Typeset & View command, it would always output all the typesetting information, but if the PDF was succesfully created, and being set to open in an external viewer, it could then close the output window by outputting a <script> tag or having the controlling JS do it (depending on how the command is implemented).