Execute script upon swapping windows