App restarter

I want to make a script which periodically restarts a piece of software.

It should

  1. Wait 5 minutes
  2. Quit application x
  3. Launch application x
  4. Repeat

I have no idea where to start. Got any tips?

Search for ‘on idle’

on idle
set appName to "Finder"
tell application appName to quit
tell application appName to launch
return 300
end idle

save this as an stay open application otherwise the idle handler won’t run (script stops immediatly)

Cool, I’ll give that a try. Thanks.