I' m trying to convert a piece of code I have for automating a simple task. i have a file called ABC.TXT filled with lines of text, I would like to insert this text into application TEST.EXE with a TAB in front...
it starts running fine, but it inserts the text a1 into the EXE, instead of the data from ABC.TXT.
does someone know what is wrong with the following script?
thanks in advance for your time & afford
it starts running fine, but it inserts the text a1 into the EXE, instead of the data from ABC.TXT.
does someone know what is wrong with the following script?
Code:
filespec="C:\ABC.txt" 'my data file
dim a,s
s=createobject("scripting.filesystemobject").opentextfile(filespec,1,true).readall
a=split(s,vbcrlf)
set WshShell = CreateObject("WScript.Shell")
for i=0 to ubound(a)
if trim(a(i))<>"" then
'Bring the application to the foreground
WshShell.AppActivate "TEST.EXE"
wscript.sleep 500
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "a(1)"
WshShell.SendKeys "{ENTER}"
end if
next
thanks in advance for your time & afford