OK...I took another run at this problem I posted previously but I'm still having problems with the script zipping on thru the series of steps and not waiting long enough for the mouse clicks to happen. arrrrggghh....what am I doing wrong?
Here's the script:
Repeat>r
// Get the acctno for this row
DDERequest>Excel,Infilename,R%r%C1,acctno,13
// Remove the CRLF that Excel adds
StringReplace>acctno,CRLF,,acctno
wait>.05
// MACRO STARTS ON THE ACCOUNT SELECT SCREEN WITH THE
// PROPER COMPANY ALREADY SELECTED
SetFocus>Account*
Wait>0.5
MouseMove>287,148
Wait>0.5
LClick
// Paste account number in CCS window
Wait>1.0
Send>%acctno%
Wait>.05
// PRESS BINOCULARS
MouseMove>15,166
LClick
wait>.05
// THIS CODE PRESSES THE OK BUTTON TO CLOSE THE NODATA WINDOW IF PRESENT
IfWindowOpen>CCS Desktop
WriteLn>Outfile1,outresult,%acctno%
Wait>1.5
// CLOSE NO DATA WINDOW
// SCRIPT FINDS THIS WINDOW OK AND WILL EXECUTE THESE CLICKS
// JUST FINE WHEN I STEP THRU IN DEBUG MODE.
// BUT WHEN I RUN THE SCRIPT...IT ZIPS ON THRU THESE CLICKS AND
// GOES TO THE NEXTACCT LABEL AND KEEPS ON TRUCKIN"
// HOW DO I GET THIS THING TO WAIT LONG ENOUGH SO THAT THE
// RED CLICKS ACTUALLY GET EXECUTED AT THE PROPER TIME & PLACE?
MouseMove>640,450
Wait>0.5
LClick
Wait>0.5
MouseMove>619,95
LClick
Wait>0.5
Goto>NextAcct
ELSE
ENDIF
// DO A BUNCH OF STUFF HERE
label>NextAcct
Wait>0.5
MouseMove>24,65
Wait>0.5
LClick
// Get next account number
Let>r=r+1
Wait>0.5
Until>r=6
Still have problem with script waiting
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
You need to tell the script to wait. Usually we use WaitWindowOpen and/or WaitWindowClosed as a minimum but there are lots of other ways depending on the application you're dealing with.
Have you read this:
http://www.mjtnet.com/blog/2006/01/17/h ... on-script/
Have you read this:
http://www.mjtnet.com/blog/2006/01/17/h ... on-script/
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?