Does anyone know of any limitations to using SendKeys to an HTA?
I'm using a TEXTAREA element and sending keystrokes to it. It seems to work
fine until a certain point. For example, in the code below, upon loading, it
will loop from 1 to 1000, each time adding a line number then going to the
next line.
Results in the textarea _should_ look like this:
1
2
[...snip...]
999
1000
On my PC, it only goes to about 850 and looks like this:
1
2
[...snip...]
849
850
Occassionally it will stop a few characters more or less, but usually right
about that location.
If I run it through less than 850 (i.e. 800, even 845) it runs just fine.
Maybe it's a machine speed limitation? I'd be curious to know if others get
less or more on faster/slower PCs.
I'm on a 3Ghz Dell Precision with 256MB RAM.
--- Code Below ---
<HTML>
<HEAD>
<TITLE>Default HTA</TITLE>
<HTA:APPLICATION>
</HEAD>
<SCRIPT Language="VBScript">
Sub PutInSampleText()
Set WshShell = CreateObject("WScript.Shell")
textbox.focus
st = timer()
For i = 1 to 1000
WshShell.SendKeys i & "{ENTER}"
Next
End Sub
</SCRIPT>
<BODY onLoad=PutInSampleText>
<TEXTAREA COLS=40 ROWS=30 WRAP="off" ID="textbox"></TEXTAREA>
</BODY>
</HTML>