There are many ways to do this, from writing an AppleScript triggered by launchd (complex) to using Keyboard Maestro (easy).
As @tjluoma points out, the tricky part is making sure you do not quit the app while it is doing something important. If the app has an AppleScript dictionary, you could check to see if it has a way to query its activity status. Then you could make sure it is inactive before quitting it in the KM Macro or other method.
If it does not have the ability to provide that information, another trick is to get its cpu usage with something like ps aux | grep <appname> | grep -r grep for example, parse out the cpu usage, check it for example every 30 days for a few iterations and if the cpu usage is not changing, then assume it is inactive an quit it. A bit more complex shell scripting but not really hard to do.
There is also an app specifically designed for quitting inactive apps. I cannot recall the name offhand but I am sure someone here will remember it.
I would also point out that bunch isn’t really designed for this purpose and would take some creativity in the bunch file to accomplish this task. Also, bunch as far as I know does not automatically trigger (I could be wrong, I have not looked at the documentation recently) and so you still need a way to automatically trigger it.
For this kind of automatic activity, my fallback is always Keyboard Maestro. It’s just the easiest way to get things like this done.
Indeed. You could just have a macro that re-starts the app any time it quits.
If iFlicks will prompt you to not quit if it is busy, Keyboard Maestro is also the best way to quit it, because you can send the quit command, and then just wait for the “Are you sure you want to quit” prompt, if it comes, and select ‘Cancel’ if iFlicks is indicating it is busy.
Or, if restarting it once a day is enough, you could just set a time when it’s likely to be idle, such as 4:00 a.m., and have a script quit the app and re-launch it.
Actually, another thought just occurred to me… maybe the best solution is to not leave the app running, launch it when needed, and then immediately quit it when it is finished.