private void recordWindowClosing(Window window) {
List<Window> windows = windowMonitor.getAllWindows();
if (!windows.contains(window))
return;
WindowClosingAction action = new WindowClosingAction(WindowIdCreator.createWindowId(window, windowMonitor), scriptModel);
recorder.record(action.enscript());
}