home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 August
/
Chip_1999-08_cd.bin
/
sharewar
/
visds
/
sktest.DSC
< prev
next >
Wrap
Text File
|
1999-05-02
|
2KB
|
92 lines
title SendKey Test
%A = Wordpad
%W = Document - Wordpad
%Z = Save As
if @winexists(%W)
window activate,%W
else
run %A.EXE
wait 4
end
%W = @winexists(%W)
file delete,test.txt
wait 1
window position,%W,84,480,400
rem enter some text
window send,%W,This is a test string@CR()
gosub checkok
window send,%W,The current directory is @curdir()@CR()
gosub checkok
window send,%W,@tab()This text is indented.@CR()
gosub checkok
window send,%W,@shift(and this text is in capitals)@cr()
gosub checkok
window send,%W,$123+ú456=ú789!! 5 > 4 = true?@CR()
gosub checkOK
window send,%W,The date is: @alt(I)D@CR()@cr()
wait 1
gosub checkok
window send,%W,Let's copy some text to the clipboard...@CR()
wait 1
gosub checkok
window send,%W,@ctrl(@key(home))@shift(@key(end)@key(down)@key(down)@key(down)@key(end))
wait 1
window send,%W,@ctrl(c)
wait 1
window send,%W,@ctrl(@key(end))
wait 1
window send,%W,... and insert the copied text here.@CR()
wait 1
gosub checkok
window send,%W,@shift(@key(ins))
window send,%W,@cr()@cr()
wait 3
window send,%W,Here are some accented characters:@CR()
gosub checkok
window send,%W,ÇατΦΘδε≡⌠∙°@chr(255)@CR()
gosub checkok
window send,%W,@CR()
wait 2
window send,%W,@CR()Now let's save the file.@CR()
gosub checkok
rem save the file as TEST.TXT
window send,%W,@alt(F)A
rem wait for Save As dialog
%C = 1000
repeat
%C = @pred(%C)
if @zero(%C)
warn Cannot find window %Z - aborting
exit
end
until @winexists(%Z)
wait 1
window send,%Z,Test
wait 2
window send,Save As,@chr(27)
wait 1
window send,%W,Changed my mind!@CR()
wait 2
rem quit Notepad
window send,%W,@alt(FX)
%C = 1000
repeat
%C = @pred(%C)
if @zero(%C)
warn Cannot find window %A - aborting
exit
end
until @winexists(%A)
wait 1
rem select No option on dialog
window send,%A,@alt(n)
exit
:checkok
if @not(@ok())
window send,%W,** The result of "@ok()" was false after the@CR()
window send,%W,** previous line was sent"," indicating that@CR()
window send,%W,** one or more of the characters was not@CR()
window send,%W,** a valid keyboard character.@CR()
end
exit