AppleScript runs twice? This script should say a b just once but many times it says a b a b.

I think this has something to do with Saved application stage. I emptied Saved application stage folder for this script then locked it. Then script works for a while but then after few runs it starts to say a b a b again.

How i can fix this?

--stay open

on run
    say "a"
    say "b"
end run

on my_stuff()
    say "my stuff"
end my_stuff

on idle
    my_stuff()
    return 30
end idle

on quit
    say "quit"
    continue quit
end quit
Try to put a delay before such as:

on run
    delay 5
    say "a"
    say "b"
end run