// Use a scriptJob to pop up a farewell message when the window is closed
scriptJob -uiDeleted myWindow "confirmDialog -message \"Buh-bye!\"";
Techically, if you put this command in your createWindow function, should you also be handing it a "-runOnce" flag? Correct? I am pretty sure the answer is "yes".