send> command prob.

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Jmac2501
Pro Scripter
Posts: 76
Joined: Tue Nov 15, 2005 8:11 pm

send> command prob.

Post by Jmac2501 » Mon Nov 21, 2005 5:14 pm

Hey i am having a problem i hope you can help me with. I have been using this scrip for a few days now with no probs but now for some reason it stoped working. In the script there is a command send>%Mydialog.msEdit#% and a little over half the time it works perfict but then some times it dosn't work at all. How can i better the script to make it work %100 of the time. One more point i will add is that i started this in 7.2 and it worked perfict there then i upgraded to 7.4 and it worked for a while but now is having probs. the only thing i changed is else where in the script not on this SRT>fail2. Here is the script

:arrow: = problem spot

srt>fail2
capsoff
wait>1
wpc>13421772,947,223,5
wait>.25
GetRectCheckSum>37,363,40,365,grcs1
if>%grcs1%1046898,error3b
gpc>656,583,pc7
if>%pc7%=0,error3b
gpc>270,341,pc3
if>%pc3%=394231,end
gpc>359,394,pc4
if>%pc4%=255,end
let>x=%x%+1
Press ALT
Send>o
Release ALT
label>2
wait>.5
mou>903,627
lcl
wpc>394231,138,205,0
press alt
send>l
release alt
wait>.5
Send Character/Text>%MyDialog.msComboBox1%
press tab
:arrow: Send Character/Text>%MyDialog.msEdit5%
Press tab
:arrow: Send Character/Text>%MyDialog.msEdit1%
Press tab
:arrow: Send Character/Text>%MyDialog.msEdit2%
Press enter
wait>1
Press CTRL
wait>.75
Send>s
wait>.75
Release ctrl
wait>.5
mou>915,116
lcl
mou>935,275
lcl
mou>51,61
lcl
press alt
send>c
Release ALT
mou>355,390
Let>%MyDialog.MsEdit5%=
Let>%MyDialog.msEdit1%=
Let>%MyDialog.msEdit2%=
Let>MyDialog.msEdit4=x
ResetDialogAction>MyDialog
goto>MainLoop
end>fail2

any ideas? i have tryed wait> and some others like the F8 walkthrough but it just forgets what to write some times. Thanks

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Nov 21, 2005 6:18 pm

Hi,

Please explain exactly what you mean by "It stopped working". I expect it IS working, but just isn't doing quite what you are thinking it should do.

The area you highlighted has some Send commands but you have no proceeding SetFocus or, for that matter, any other window functions. The characters are probably flying off into nowhere, or landing on some other window. How do you know they will end up on the application you want them to end up on?
MJT Net Support
[email protected]

Jmac2501
Pro Scripter
Posts: 76
Joined: Tue Nov 15, 2005 8:11 pm

Post by Jmac2501 » Mon Nov 21, 2005 6:58 pm

OK lets me try and explane better. What i put into msEdit5 isn't being displayed once you leave the dialog box. I even put in a Messagemodal>%Mydialog.msEdit5% to see if it would display what i put into msEdit5 there and it would be blank. Some times it works, more then not it works and will display msEdit5 just fine. but then for some reason it won't. And as for the letters flying places as soon as the screen that is needs shows up it puts the mouse in the input field that its needs so thats not the problem because i can see the curser in the right fields but there is no input. I don't know what else to do. I will post my Whole scrip maybe you can pick out whats wrong. and i will add in notes and what i pick in blue

Let>k=0
let>x=0
Dialog>MyDialog
Caption=Pass Or Fail It.
Width=306
Height=223
Top=329
Left=237
Max=1
Min=1
Close=1
Resize=1
Image=,144,80,105,105
Label=#FAIL,152,8
Label=#PASS,112,8
Label=Type Failure's Here:,8,40,true
Label=Enter Notes Here:,8,80,true
Image=C:\Documents and Settings\jmccoard\My Documents\My Pictures\Snowboard-Sierra1.bmp,0,0,297,193
Label=#PASS,112,8,true
Label=#FAIL,152,8,true
Button=PASS (NTF),192,8,105,33,1
Button=Fail It,216,48,74,33,3
Button=Exit Macro,197,128,92,25,2
Button=Resize,8,128,73,25,4
Button=Fail it w/ Notes,96,128,89,25,5
ComboBox=msComboBox1,8,8,97,COMBO%CRLF%DFL%CRLF%DISPOSITION%CRLF%HYPERCOM%CRLF%IMS%CRLF%LINKPOINT%CRLF%OTV%CRLF%PRINTERS%CRLF%RFB%CRLF%RTO%CRLF%SCRAP
Edit=msEdit5,8,56,60, In this box i type in W-CTIH then push Fail it
Edit=msEdit1,80,56,60,
Edit=msEdit2,152,56,60,
Edit=MyEdit2,8,96,273,None
Button=18A0,8,160,67,25,6
Button=Test,80,160,65,25,7
Button=Clear,152,160,65,25,8
Button=704P16,224,160,65,25,9
Edit=msEdit3,112,24,33,%k%
Edit=msEdit4,152,24,33,%x%
Label=Enter Notes Here:,8,80,true
Label=Type Failure's Here:,8,40,true
EndDialog>MyDialog



Label>MainLoop
Show>MyDialog,result
if>result=1,NTF
If>result=2,end1
If>result=3,SayHello
if>result=4,resize
if>result=5,failnote
if>result=6,18a0
if>result=7,test
if>result=8,clear
if>result=9,704p16
Goto>MainLoop

SRT>SayHello
gpc>150,115,pc1
if>%pc1%394231,Error1
Vbstart
Function GetSerNum

GetSerNum = InputBox("Enter Your Serial Number : ")

End Function
vbend

VBEval>GetSerNum,sernum
mou>671,377
lcl
wait>.50
send>%sernum%
press enter

gpc>150,115,pc1
if>%pc1%=394231,fail2
if>%pc1%394231,Error1

END>SayHello

SRT>NTF
gpc>150,115,pc1
if>%pc1%394231,Error1
Vbstart
Function GetSerNum

GetSerNum = InputBox("Enter Your Serial Number : ")

End Function
vbend

VBEval>GetSerNum,sernum
mou>671,377
lcl
wait>.50
send>%sernum%
press enter
gpc>150,115,pc1
if>%pc1%=394231,NTF2
if>%pc1%394231,Error1

END>NTF

srt>NTF2
wpc>13421772,947,223,5
wait>.25
GetRectCheckSum>37,363,40,365,grcs1
if>%grcs1%1046898,error3
gpc>656,583,pc7
if>%pc7%=0,error3
gpc>270,341,pc3
if>%pc3%=394231,end
gpc>359,394,pc4
if>%pc4%=255,end
Press ALT
Send>o
Release ALT
label>1
let>k=%k%+1
wait>.5
mou>903,627
lcl
wpc>394231,138,205,0
press alt
send>l
release alt
wait>.5
Send Character/Text>%MyDialog.msComboBox1%
press tab
Send Character/Text>W-NTF
Press enter
wait>.5
Press CTRL
wait>.75
Send>s
wait>.75
Release ctrl
mou>774,619
lcl
wpc>766,44,119,0
wait>.5
endif
gpc>77,263,pc6
if>%pc6%=16711680,noteshere
Send Character/Text>NTF
press enter
send>Swap Analysis = %MyDialog.MyEdit2%
press tab
Send Character/Text>Technician Notes
press enter
Press CTRL
Send>s
Release ctrl
wpc>16711680,77,263,0
wait>.5
wpc>13421772,869,425,0
mou>915,116
lcl
mou>935,275
lcl
mou>51,61
lcl
press alt
send>c
Release ALT
mou>355,390
Let>MyDialog.msEdit3=k
ResetDialogAction>MyDialog
goto>MainLoop
end>NTF2

srt>fail2
wait>1
wpc>13421772,947,223,5
wait>.25
GetRectCheckSum>37,363,40,365,grcs1
if>%grcs1%1046898,error3b
gpc>656,583,pc7
if>%pc7%=0,error3b
gpc>270,341,pc3
if>%pc3%=394231,end
gpc>359,394,pc4
if>%pc4%=255,end
Press ALT
Send>o
Release ALT
label>2
let>x=%x%+1
wait>.5
mou>903,627
lcl
ask>%MyDialog.msEdit5%,ANS I just use this as a varifyer that it will display W-CTIH but some times stays blank
If>ANS=NO,MainLoop
wpc>394231,138,205,0
press alt
send>l
release alt
wait>.5
Send Character/Text>%MyDialog.msComboBox1%
press tab
Send>%MyDialog.msEdit5% Here it should show up as W-CTIH but stays Blank SOMETIMES
wait>.5
Press tab
Send Character/Text>%MyDialog.msEdit1%
wait>.5
Press tab
Send Character/Text>%MyDialog.msEdit2%
wait>.5
Press enter
wait>1
Press CTRL
wait>.75
Send>s
wait>.75
Release ctrl
wait>.5
mou>915,116
lcl
mou>935,275
lcl
mou>51,61
lcl
press alt
send>c
Release ALT
mou>355,390
Let>%MyDialog.MsEdit5%=
Let>%MyDialog.msEdit1%=
Let>%MyDialog.msEdit2%=
Let>MyDialog.msEdit4=x
ResetDialogAction>MyDialog
goto>MainLoop
end>fail2
/// thats it then it starts back to the beginning
srt>failnote
gpc>150,115,pc1
if>%pc1%394231,Error1
Vbstart
Function GetSerNum

GetSerNum = InputBox("Enter Your Serial Number : ")

End Function
vbend

VBEval>GetSerNum,sernum
mou>671,377
lcl
wait>.50
send>%sernum%
press enter
gpc>150,115,pc1
if>%pc1%=394231,failnote1
if>%pc1%394231,Error1
end>failnote

srt>failnote1
wait>1
wpc>13421772,947,223,5
wait>.25
GetRectCheckSum>37,363,40,365,grcs1
if>%grcs1%1046898,error3c
gpc>656,583,pc7
if>%pc7%=0,error3c
gpc>270,341,pc3
if>%pc3%=394231,end
gpc>359,394,pc4
if>%pc4%=255,end
Press ALT
Send>o
Release ALT
label>3
let>x=%x%+1
wait>.5
mou>903,627
lcl
wpc>394231,138,205,0
press alt
send>l
release alt
wait>.5
Send Character/Text>%MyDialog.msComboBox1%
press tab
Send Character/Text>%MyDialog.msEdit5%
Press tab
Send Character/Text>%MyDialog.msEdit1%
Press tab
Send Character/Text>%MyDialog.msEdit2%
Press enter
wait>2
Press CTRL
wait>.75
Send>s
wait>.75
Release ctrl
wait>1
mou>774,619
lcl
wpc>766,44,119,0
wait>.5
gpc>77,263,pc6
if>%pc6%=16711680,noteshere
Send Character/Text>%MyDialog.MyEdit2%
press tab
Send Character/Text>Technician Notes
press enter
Press CTRL
Send>s
Release ctrl
wpc>16711680,77,263,0
wait>.5
wpc>13421772,869,425,0
mou>915,116
lcl
mou>935,275
lcl
mou>51,61
lcl
press alt
send>c
Release ALT
mou>355,390
Let>%MyDialog.MsEdit5%=
Let>%MyDialog.msEdit1%=
Let>%MyDialog.msEdit2%=
Let>MyDialog.msEdit4=x
ResetDialogAction>MyDialog
goto>MainLoop
end>failnote1

srt>resize
gpc>694,398,pc2
if>%pc2%16777215,error2
mou>694,398
lcl
wait>.50
send>710-743-659
press enter
Press ALT
Send>o
Release ALT
wait>1
mou>915,116
lcl
mou>935,275
lcl
mou>51,61
lcl
press alt
send>c
Release ALT
end>resize

srt>Error1
MessageModal>Repair screen out of place! Push the "Resize screen" button on the Pass it or Fail It Dialog.
goto>MainLoop
end>Error1

srt>error2
messagemodal>Repair screen is out of place, just do this unit manuly and you can use me next time. sorry :( If this Message continues to pop up and your are running Windows Xp you need to switch it to classic mode. To do this right click on your desktop go to properties, apperarance, windows and buttons and switch it to Classic view.
goto>MainLoop
end>error2

Srt>error3
ask>This is a multi line unit or an RO. Do you wish to continue? (Note not recomended for RO's).,yes/no
if>yes/no=YES,F11
goto>MainLoop
end>error3

Srt>error3b
ask>This is a multi line unit or an RO. Do you wish to continue? (Note not recomended for RO's).,yes/nob
if>yes/nob=YES,F11b
goto>MainLoop
end>error3b

Srt>error3c
ask>This is a multi line unit or an RO. Do you wish to continue? (Note not recomended for RO's).,yes/noc
if>yes/noc=YES,F11c
goto>MainLoop
end>error3c

label>F11
Press ALT
Send>o
Release ALT
wait>1
mou>194,574
lcl
press F11
wpc>15726815,125,574,0
mou>122,574
lcl
wait>.25
send>%sernum%
wait>.25
press ctrl
press F11
release ctrl
wait>1
goto>1

label>F11b
Press ALT
Send>o
Release ALT
wait>1
mou>194,574
lcl
press F11
wpc>15726815,125,574,0
mou>122,574
lcl
wait>.25
send>%sernum%
wait>.25
press ctrl
press F11
release ctrl
wait>1
goto>2

label>F11c
Press ALT
Send>o
Release ALT
wait>1
mou>194,574
lcl
press F11
wpc>15726815,125,574,0
mou>122,574
lcl
wait>.25
send>%sernum%
wait>.25
press ctrl
press F11
release ctrl
wait>1
goto>3

srt>noteshere
Messagemodal>There are notes here if you want to add more notes now you can.
goto>MainLoop
end>noteshere

srt>18a0
mou>29,753
lcl
wait>.5
mou>40,684
lcl
send>"C:\Omni3750 OS 18AO\Copy of load.bat"
press enter
mou>264,583
end>18a0

srt>test
mou>29,753
lcl
wait>.5
mou>40,684
lcl
send>"C:\Omni37xx Test\1.BAT"
press enter
mou>264,583
end>test
srt>clear
mou>29,753
lcl
wait>.5
mou>40,684
lcl
send>"C:\verifone password\password.bat"
press enter
mou>264,583
end>clear
srt>704p16
mou>29,753
lcl
wait>.5
mou>40,684
lcl
mou>264,583
send>C:\704P16SerialUpgrade\704P16Serial.bat
press enter
end>704p16

srt>end
Messagemodal>there was an error. Please try agin
goto>MainLoop
end>end

label>end1

Hope this helps alittle bit

Jmac2501
Pro Scripter
Posts: 76
Joined: Tue Nov 15, 2005 8:11 pm

Post by Jmac2501 » Mon Nov 21, 2005 9:28 pm

ok here is somthing i found out. If i restart the program every time it works but if i do more then one before restarting it dosn't work. So i am thinking it might be the ResetDialogAction>MyDialog used for the counter that is messing it up. what do you think???

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Nov 21, 2005 9:39 pm

You really need to run through this with the debugger to see what is happening. I would add a message box or timestamp command just after the Show command to display/log the value of the edit field. Then you can see at each iteration what the value is to be sure it's set in the dialog. If so then the value is being obliterated after this point. If not then nothing was entered.

One potential problem with your script is that your VBSTART/VBEND blocks are within your loop and therefore at every iteration Macro Scheduler is loading identical VBScript code. You could very well run into some nasty issues doing that. You only need to define VBScript code ONCE, no matter how many times you call it. Put your VBSTART/VBEND block(s) at the very TOP of your script.
MJT Net Support
[email protected]

Jmac2501
Pro Scripter
Posts: 76
Joined: Tue Nov 15, 2005 8:11 pm

Post by Jmac2501 » Mon Nov 21, 2005 9:48 pm

ok I have found the problem at the end on each SRT> i had put in a
Let>%Mydialog.msEdit%= to clear out the dailog so once i removed the % % it works perfict now. sorry for the trouble next time i will try harder before bothering you guys. thanks anyway

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts