I want to make a macro that would do something, in my case it would do some keystrokes :
And then I wish it would listen for a return keystroke for some time and if it is pressed activate esc, if not do nothing.
My use case is that I want to activate a prefilled search, then make the search and when I press return on the search, do escape key as well. If I don’t however or change my mind, nothing should happen and it should stop listening to keystrokes.
I’ll take a shot.
set the “Set Action Timeout…” to your ‘some time’ on the ‘if all conditions’ step.
ie. 2 minutes or what ever you like.
Then after that step put a
If
Variable Last_Action contains Action timeout exceeded
then
nothing
else
xxx
I was thinking I could use a for loop here. Make an action block that would run for 5 seconds and in there watch for return keystroke. And then quit macro running once time is up or return key was pressed.
Under the 'gear' icon of the step.
Set that timeout to the time you want to wait.
Be sure to UN check 'timeout aborts macro'
Then set the next step to be the set variable xxxx to
%ActionResult%
Base your next step on the variable xxxx
If = OK (or Action Timeout exceeded) then action A
else
action B
Also, I have posted several examples in this forum of how to use a Pause Until to wait on a keystroke. Please do some searching and you will find them.