Quitting applescript app

I have a timer application that uses a delay command before it displays an alert but I don’t seem to be able to quit the thing unless I force quit it.

I tried adding an “on quit” handler but that doesn’t seem to do much.

I guess designing a timer as a self-contained .app is bound to create issues if I want to run multiple instances of that thing (to have multiple timers running).

What would be the best approach to have that ?

Thank you in advance.

That depends what you put inside the handler.

What are you timing?

That’s possibly part of the problem. Rather than a delay, which I have a feeling will just block the process, you might try and use an on idle handler.

What I put in the quit handler is as per the manual:

on quit
    continue quit
end quit

What I’m timing is just time… I’m creating an alert for a thing I have to do in N minutes. So I have a dialog that asks for how many minutes it must wait and after that time has passed the script displays a dialog “do your stuff”.

I used to script Reminders for that but it was not reliable so I decided to use an AS only approach.