Another solution would be to launch a parent script like the one above that loops. The script could then launch additional processes which it would have to monitor. When Esc is pressed the parent script would need to kill the children or set a flag file which the child process would pick up and terminate.
_________________________
Home page: http://www.kixhelp.com/hb/