Hmmm.
Not sure why it's not working. When you open the window form the calendar, there should just be one record in the found set, so when you close the window this should be true
IF [Get ( FoundCount ) = 0 and ValueCount ( WindowNames ( Get (FileName ) ) ) > 1 and Get ( TotalRecordCount ) > 0]
and run the part of the script that closes the window and runs the refresh. The thing I can think of is that if you only have one event and are deleting the last one, then that part won't run.
If you have Advanced, can you check this script with the debugger to see what's not happening?

- Script.png (151.85 KiB) Viewed 7454 times
Let me know if that helps,
-Jason