- May
- 13,157
- 180
I want to automate pressing "Y" when my editor prompts "OK to create ..." with a message box. Here's my attempt so far, TPAD.BTM.
If I issue tpad.btm
The first message box appears and that's it! The BTM doesn't continue until I have (manually) dismissed both message boxes and the keystrokes wind up in one of the documents. What's going on there? Is there anything I can do about it?
Code:
::TPAD.BTM
setlocal
echo on
set noexist=0
do i=1 to %#
if not exist %[%i] set noexist=%@eval[%noexist + 1]
enddo
d:\TextPad7\TextPad.exe %$
iff %noexist GT 0 then
do i=1 to %noexist
keystack /w18 "Y"
enddo
endiff
If I issue tpad.btm
xx1.txt xx2.txt
(both files non-existent), I see
Code:
set noexist=0
do i=1 to %#
if not exist %[%i] set noexist=%@eval[%noexist + 1]
if not exist %[%i] set noexist=%@eval[%noexist + 1]
d:\TextPad7\TextPad.exe xx1.txt xx2.txt
The first message box appears and that's it! The BTM doesn't continue until I have (manually) dismissed both message boxes and the keystrokes wind up in one of the documents. What's going on there? Is there anything I can do about it?