I have asked to join your forum. I am sure you are very busy and do not have time for my question. I am a doctor and very much an armature on programming but dangerous enough to get me in trouble. I have been researching for about 10 hours on using the help and internet on Tera Term macros or scripts. I have created the following script below and I use this to submit insurance claims to a clearinghouse. As you will see the logon is quite extensive and I have successfully made this script work up to the point of transmitting a file. I need to send the file zmodem out of a different directory the teraterm. I am providing you with my script where I receive an error when it gets to the changedir command. And if I do place the file in the teraterm directory and remove the changedir command line I still get and error on the zmodem command line. This is probably something you do not want to deal with. And I am sure I am showing my ignorance. If by chance you have a suggestion other than a flame I would appreciate if greatly. Thank you for your time.
Richard Zenger
rgzing@aol.com
This is the macro for file transmission: I understand if you do not care or have time. Just a shoot in the dark looking for assistance. It has been 25 year since I did programming of any kind at University of Tennessee. And we used punch cards!!!
; macro for Tera Term
; Dial-up login
; open Tera Term
; command line = 'TERATERM /C=3' (COM1 port)
connect '/C=3'
DialPrefix = 'ATD'
; set phone number, username, and password
PhoneNumber = '1,555-555-1212'
Productionprompt = '(P/T)?'
Production = 'p'
Correctprompt = '(Yes or No)'
Correct = 'yes'
Loginprompt = 'Logon ID:'
Login = 'yyy1234'
Passwordprompt = 'Password:'
Password = 'pass123'
Uploadprompt = 'G)oodbye'
Upload = 'U'
Submitterprompt = 'Submitter/Provider:'
Submitter = 'S'
Medicalprompt = 'type:'
Medical = 'M'
Zipprompt = '(Y/N)'
Zip = 'Y'
Fileprompt = 'K)ermit'
File = 'Z'
; initialize modem (see the manual for your modem)
sendln 'ATZ'
wait 'OK'
; dial up
:dial
send DialPrefix
sendln PhoneNumber
; set timeout (30 sec)
timeout = 30
; wait for strings from modem
wait 'CONNECT 9600' 'BUSY' 'NO CARRIER'
; pause 2 sec
pause 2
; timeout?
if result=0 goto conn
; 'CONNECT'?
if result=1 goto conn
; 'BUSY'?
if result=2 goto redial
; 'NO CARRIER'
if result=3 goto error
; error. stop macro
:error
messagebox 'Dialing error!' 'Tera Term'
end
:redial
yesnobox 'Busy! Try again?' 'Tera Term'
if result goto dial
end
; connect!
:conn
; login
wait Productionprompt
pause 2
sendln Production
wait Correctprompt
pause 2
sendln Correct
wait Loginprompt
pause 2
sendln Login
wait Passwordprompt
pause 2
sendln Password
wait Uploadprompt
pause 2
sendln Upload
wait Submitterprompt
pause 2
sendln Submitter
wait Medicalprompt
pause 2
sendln Medical
wait Zipprompt
pause 2
sendln Zip
wait Fileprompt
pause 2
sendln File
pause 3
This is where the program bombs out!!
zmodemsend 'test.dat' 1
if result = 1 goto logoff
:logoff
wait ‘transfer complete’
send ‘n’
wait ‘goodbye’
send ‘g’
end