quiting a stay open app

All,

I have a script saved as a stay open app in the idle routine I have sub routine that asks for a serial number after 20 days has passed. if the serial number is not entered correctly the script should quit

but if just click the ok button the script takes to long to quit and continues the idle handler and will procsess files rather than quiting

any suggestion would be greatly appreciated

thank
MM

you can force quit it maybe:

do shell script "killall -c TheApplicationName"

well I figured it out because its a subroutine called in the idle routine I just have it return true or false
then I can run branch using if then else

thanks for the imput

Mike