how many times does someone open a window with no switches, you really need to check up to $4, then again what if its a -c for close, or the window already exists, and after you managed all that, and coded for all possablities, oh no someone went and said !window.

A timer would be alot easier, and if its a sound to be heard, i would guess the windows gonna remain open, so a 1 seconds time would liekly be enough,