Fix AppleScript error caused by the window in the XIB