WaitReady not work with this window.

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Reimon
Pro Scripter
Posts: 55
Joined: Wed Mar 31, 2004 4:46 pm

WaitReady not work with this window.

Post by Reimon » Tue Jun 15, 2004 10:17 am

Hello !

I have a window that, after carrying out a process of Backup, active a button to conclude the process.

I use "Wait" before pressing with MouseMoveRel the button to wait to that is activated but the problem is that this process doesn't always have same duration.

I have proven with "WaitReady" but it doesn't work with this window.

Any suggestion?

Greetings,

Reimon

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Jun 15, 2004 1:48 pm

Is it possible that you need to insert Let>RP_WAIT=1 before you run that backup program?

Please provide a sample of the script that is causing the problem.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Reimon
Pro Scripter
Posts: 55
Joined: Wed Mar 31, 2004 4:46 pm

WaitReady

Post by Reimon » Tue Jun 15, 2004 3:22 pm

Hello Bob,

I think is a sample script.

I have substituted Wait>240 for WaitReady but WaitReady not work.

This is for a window that it carries out the backup process and when it ends it activates the button END that until that moment is gray.

Greetings,

Reimon

Change Directory>c:\pr\bin\
Run Program>"c:\pr\bin\backup.exe"
Wait>2
Press Page Down
Wait>2
Press ALT
Send>a
Release ALT
Wait>2
MouseMoveRel>327,224
LClick
Wait>2
MouseMoveRel>71,379
LClick
Wait>2
Send>0
Wait>2
MouseMoveRel>192,51
LClick
Wait>2
MouseMoveRel>192,51
LClick
Wait>2
MouseMoveRel>237,419
LClick
Wait>2
MouseMoveRel>235,242
LClick
Wait>2
WaitReady>1 ------- I have substituted Wait>240 for WaitReady
Wait>2
MouseMoveRel>235,242
LClick
Wait>2
MouseMoveRel>359,151
LClick
WaitReady>1
Wait>2
MouseMoveRel>210,109
LClick
Wait>10
MouseMoveRel>421,372
LClick

Lumumba

Post by Lumumba » Tue Jun 15, 2004 4:19 pm

Maybe stupid question, have you checked if your backup program provides commandline parameters (so you can get rid of frontend clicking orgies)?

Check for the final End button using the GetPixelColor>/WaitPixelColor> commands

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Tue Jun 15, 2004 4:51 pm

Hello Reimon,

I'm somewhat astonished by the relatively large number of MouseMoveRel> commands, which depend upon perfect timing of the opening and closing of several dialog boxes. In actuality, the perfect timing rarely exists.

Before firing up a MouseMoveRel> command, I would rather ascertain that the desired dialog box is readily available by means of GetActiveWindow> commmand.
For example,

Label>WaitHere
Wait>2
GetActiveWindow>Window,X,Y
// Assume the name of the dialog box is Backup
Pos>Backup,Window,1,Pos
If>Pos=0,WaitHere
WaitReady>1
MouseMoveRel>235,242

You may employ WaitWindowChanged>, WaitCursorChanged>, GetRectChecksum>, WaitWindowOpen>,...etc to attain the perfect timing.

Hope you find the above sample script useful.
Last edited by armsys on Wed Jun 16, 2004 12:19 am, edited 1 time in total.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Jun 15, 2004 5:53 pm

WaitReady> is commonly used after you confirm a Window is open. Something like this:
WaitWindowOpen>WindowName*
SetFocus>WindowName*
WaitReady>1
Do Stuff Here..........
I suspect that you don't want to do anything until the backup routine is finished. Using Wait>240 is probably better handled with RP_WAIT variable. I would add RP_WAIT setting like this:
Change Directory>c:\pr\bin\
Let>RP_WAIT=1
Run Program>"c:\pr\bin\backup.exe"
Let>RP_WAIT=0
Wait>2


This will tell Macro Scheduler to stop all script processing until the backup.exe program has completed. Once the program is done. then the rest of the script will run.

Like armsys, I also cringe at the MouseMoveRel> commands before each of your mouse clicks. Is there a way you can use Tabs, Shift-Tabs, UP/Down arrows to navigate instead? i have found that hard key commands are usually more reliable than Mouse Movements.

Exactly where are you getting the error message? Have you single stepped through the script? Have you run real time and looked at the log?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Reimon
Pro Scripter
Posts: 55
Joined: Wed Mar 31, 2004 4:46 pm

Post by Reimon » Wed Jun 16, 2004 9:12 pm

Bob, Lumumba, Armstrong,

Thank you for your suggestions.

Now I have a lot of work in proving all.

Your friend,

Reimon

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