i have a scrpt that i did about 4 verions ago .
i made changes with the new version 7.2.5
and it give me an error every time i run it or debug it i belive it is in my mdstrng line .if anyon can help me i would greatly apreciate it here is the script
exe>c:\militarypac.pdf
wait>1.0
Press Tab
Wait>1.5
Readln>c:\credit.txt,7,theline
let>c:\credit.txt,7,=theline
length>line,le
let>numcharts=le,-2
MidStr>theline,2,numchars,theline
send>theline
wait>1
thanks tim
midstr
Moderators: JRL, Dorian (MJT support)
exe>c:\militarypac.pdf
wait>1.0
Press Tab
Wait>1.5
Readln>c:\credit.txt,7,theline //read line 7 of the file named credit.txt and store its content in the variable theline
let>c:\credit.txt,7,=theline //sets a variable named c:\credit.txt,7, with the line content which has been detected the line ago
length>line,le //get the lenght of a variable which hasn't been set
let>numcharts=le,-2 //sets a variable named numcharts and tries to sub 2 from it in one go
MidStr>theline,2,numchars,theline // gets the string which starts from position 2 of the line which is stored in the variable theline with the length which was set in the variable the line above
send>theline // send the string which has been set to the variable theline to the window which has the focus
wait>1
---
Code reviewed. Please check if this works for you.
wait>1.0
Press Tab
Wait>1.5
Readln>c:\credit.txt,7,theline //read line 7 of the file named credit.txt and store its content in the variable theline
let>c:\credit.txt,7,=theline //sets a variable named c:\credit.txt,7, with the line content which has been detected the line ago
length>line,le //get the lenght of a variable which hasn't been set
let>numcharts=le,-2 //sets a variable named numcharts and tries to sub 2 from it in one go
MidStr>theline,2,numchars,theline // gets the string which starts from position 2 of the line which is stored in the variable theline with the length which was set in the variable the line above
send>theline // send the string which has been set to the variable theline to the window which has the focus
wait>1
---
Code reviewed. Please check if this works for you.
exe>c:\militarypac.pdf
wait>1.0
Press Tab
Wait>1.5
Readln>c:\credit.txt,7,theline
length>theline,le
sub>le, 2
let>numcharts=%le%
MidStr>theline,2,%numchars%,theline
send>%theline%
wait>1
it still isnt woring and when i follow your example code i get an error in
sub>le, 2
do you hane an email i cand send you the script ?
thanks for your help tin gantz
sub>le, 2
do you hane an email i cand send you the script ?
thanks for your help tin gantz

Lumumba wrote:exe>c:\militarypac.pdf
wait>1.0
Press Tab
Wait>1.5
Readln>c:\credit.txt,7,theline //read line 7 of the file named credit.txt and store its content in the variable theline
let>c:\credit.txt,7,=theline //sets a variable named c:\credit.txt,7, with the line content which has been detected the line ago
length>line,le //get the lenght of a variable which hasn't been set
let>numcharts=le,-2 //sets a variable named numcharts and tries to sub 2 from it in one go
MidStr>theline,2,numchars,theline // gets the string which starts from position 2 of the line which is stored in the variable theline with the length which was set in the variable the line above
send>theline // send the string which has been set to the variable theline to the window which has the focus
wait>1
---
Code reviewed. Please check if this works for you.
exe>c:\militarypac.pdf
wait>1.0
Press Tab
Wait>1.5
Readln>c:\credit.txt,7,theline
length>theline,le
sub>le, 2
let>numcharts=%le%
MidStr>theline,2,%numchars%,theline
send>%theline%
wait>1
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
I noticed an extra space in that Sub command, before the "2". It does not make a difference on a test that I did, but perhaps try removing it anyway.
From: sub>le, 2
To: sub>le,2
Also make sure you have no Trailing Space characters at the end of any of your lines. In the Editor, you can select Edit, Show All Chars, and Remove Trailing Spaces. Is a not-uncommon problem if Cut/Paste from the forum.
From: sub>le, 2
To: sub>le,2
Also make sure you have no Trailing Space characters at the end of any of your lines. In the Editor, you can select Edit, Show All Chars, and Remove Trailing Spaces. Is a not-uncommon problem if Cut/Paste from the forum.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
i solved my problem by increesing my inital wait tim from 1 sec to two the script works fine the orginal way...thanks for all the help''Tim G

Bob Hansen wrote:I noticed an extra space in that Sub command, before the "2". It does not make a difference on a test that I did, but perhaps try removing it anyway.
From: sub>le, 2
To: sub>le,2
Also make sure you have no Trailing Space characters at the end of any of your lines. In the Editor, you can select Edit, Show All Chars, and Remove Trailing Spaces. Is a not-uncommon problem if Cut/Paste from the forum.
Hello Tim,
I notice your script attempts to open a PDF file. If it's the first time (after cold boot) you run Acrobat, 2 seconds are not enough to load the Acrobat. You may consider the following code (partial):
I notice your script attempts to open a PDF file. If it's the first time (after cold boot) you run Acrobat, 2 seconds are not enough to load the Acrobat. You may consider the following code (partial):
Happy scripting.exe>c:\militarypac.pdf
Wait>0.1
WaitCursorChanged>10
WaitReady>1
Press Tab