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
WaitReady not work with this window.
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
WaitReady
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
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
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.
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.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
WaitReady> is commonly used after you confirm a Window is open. Something like this:
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?
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:WaitWindowOpen>WindowName*
SetFocus>WindowName*
WaitReady>1
Do Stuff Here..........
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!
Bob
A humble man and PROUD of it!