I got an AppleScript I wrote that is running in a Repeat loop with a delay of two seconds. However, when I save it as an application and then run it won't close when I try to quit it or it won't close on shutdown (I have to force quit). How do I have the application watch for close requests and then close?
repeat
repeat
Code:
repeat
try
#do a bunch of stuff
on error errTest number errNum
log {errtext, errNum}
end try
delay 2
end repeat