Hello,
I'm writing a macro that I want to only execute if I'm away from the computer. Basically, if an Outlook window appears announcing a new message and I'm away from the computer, I want the computer to start beeping. I'm having trouble figuring out how to reliably detect *lack* of keyboard action without aborting the macro. Thanks in advance for any ideas.
Here are the details:
I have a simple routine that detects if the mouse moves over the course of 15 seconds. I grab the x,y of the mouse coords, and then check every second to see if the x,y has changed. If it has changed, I must be at the computer, and the macro stops. If the coords have not changed, then the macro goes into a loop playing an alert wav file every second until the coords do change.
But what if the mouse hasn't moved because I'm typing? I need something similar in place to sniff keyboard activity. There's no "get last key pressed" variable command. I tried "Wait for keypress" [space] since if I'm typing I can assume that I'll hit the space at least once in 10 seconds. But I discovered that the macro aborts if it reaches its max time. What I really wanted was for it to wait a max of 30 seconds, and then continue, but stop waiting if a key is pressed. If I detect a keypress, I stop the macro. If I detect that it waited the max time before giving up, I can assume I'm away and start beeping.
Ideas?
Thanks,
-- Mike