I have an AppleScript application in which I have a background task running in an infinite loop.
repeat while true
-- do some tasks
Instead of the infinite loop implement the
on idle handler. It allows to consider the
on idle -- do some tasks return 1 end idle
However there is a restriction. The minimum interval is one second.