is it possible to run a Rhino-Plug-in (or may be a script) on program start and let it run in the background?
When exiting/closing the file, the plugin/script has to perform some actions.
As Nathan mentioned yes, you can run your logic in another thread, and set a flag, so that when the idle event in rhino fires, it can act on the flag.
The IDLE event happens a LOT. So you shouldn’t do slow work in that event, unless you are quick about it. We use the IDLE event to check and see if we need to update our UI to match the current state of Rhino.
So when another Rhino Event fires that indicates we need to update (Such as Document Updates, File Updates, Layer Updates, etc.), we set a flag, rather than doing the work. Then in the IDLE event we act upon the flag, and reset the flag.
That way our plugin isn’t slowing Rhino down, it is only “updating” when Rhino is Idle.