Using Super Search for task, and looking for posts by PodMaster, I found these two posts that should get you a long way towards your goal:
If you have further questions, you will have to post some code together with your question.
In reply to Re: I wish to monitor and react according to windows "Task Manager"
by Corion
in thread I wish to monitor and react according to windows "Task Manager"
by moked
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |