I'd like to know if you can provide a solution for two issues regarding your Autoclick.vbs example:

#1: What would be the appropriate way to allow some sleep time in the While Wend loop. I have a 5 second wait but would a sleep be better?

While Not AutoClickButton(sWindowName, sWindowButton) wait 5 Wend

#2 What if Autoclick.vbs never finds it's window and button and we call it repeatedly? How can we avoid a situation where lots of WshShells are left running? Can the function be modified to send a message to kill to it neatly? I have a function to kill processes, but I'm wondering if there is a more "elegant" solution?