Re: Sending automated keypress at timed interval?



That first link was supposed to be:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthsendkeys.asp

but anyway this one is better:

http://www.microsoft.com/technet/scriptcenter/guide/sas_wsh_pkoy.mspx
... and pretty much answers your question.

--
####################
## PH, London
####################
"Philip Herlihy" <foof8501@xxxxxxxxxxxxxxxxxxx> wrote in message
news:dlvm79$ett$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> If you are able to write scripts, see:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsoriMethods.asp
>
> Scripting is easier than you might think. See
> http://www.microsoft.com/technet/scriptcenter/default.mspx
>
> The "sendkeys" method documentation specifies that it sends keystrokes to
> the "active" window, which might be tricky. However, if you study the
> options in table 3.9 here:
> http://www.microsoft.com/technet/scriptcenter/guide/sas_wsh_pkoy.mspx
>
> ... you may be able to figure out a solution. I'd guess you could create
> a script which starts the (mystery) application making it the Active
> Window, then continues sending F2 at timed intervals.
>
> Depending on how the (mystery) application is written, you may be able to
> "redirect standard input". Just as you can type:
>
> DIR | MORE
>
> ... which "pipes" the output of DIR into a utility (MORE) which pauses
> after each pagefull, you may be able to do the same trick with your
> receiving application, but only if it's written to accept input this way.
> Most GUI applications won't be, sadly.
>
> --
> ####################
> ## PH, London
> ####################
> "David Wright" <nonewsgroupspam@xxxxxxxxx> wrote in message
> news:3ugp0sF11gsdtU1@xxxxxxxxxxxxxxxxx
>> Hello,
>>
>> I'm looking for what is probably a very simple solution - I just need a
>> simple way of sending a keypress at a specific time, on my unattended PC.
>>
>> I have a piece of software that I run, and I need to press F2 after a
>> specific time has elapsed. The software itself has not got the ability to
>> stop what it's doing, hence the need to send a timed keypress - but it
>> always occurs when I am away from the office.
>>
>> Can anyone recommend anything that can do this? It needs to be able to be
>> set up in advance with the key it needs to send, and a time at which it
>> needs to send it.
>>
>> Cheers,
>> David
>>
>
>


.