I tried to run the script/executable, for the send keys. it worked for the first run. Then after 3 seconds, I run again, it doesn't run the function. It needs to be wait a while, then the script will work again. I tried to processClose $process still can't produce consistent output.
$process = ProcessList(@ScriptName)
If ProcessExists($process) Then
ProcessClose($process)
RunKey()
Else
RunKey()
EndIf
Func RunKey()
Sleep(250)
Send("^!a")
Exit 0
EndFunc