| View previous topic :: View next topic |
| Author |
Message |
Temporary Guest
|
Posted: Thu Sep 03, 2009 7:07 pm Post subject: Help with loops/ifs? (Trying to run programs in sequence) |
|
|
I have a directory full of programs I want to run to completion. However, they all require someone to press "Ok" a few times. However, when I try to script it, the script finishes the first window fine, but then picks a random window and executes a script that now means nothing. :S
Here's the function I've got:
| Code: | #i::
MsgBox Start!
Sleep 2000
done=1
CoordMode Mouse, Relative
SetTitleMatchMode, 2
loop
{
IfWinExist Supreme World
{
WinActivateBottom "Supreme World:"
Click 366, 369
Click 353, 369
sleep 1000
Click 375, 365
}
else
{
MsgBox "Done a loop!"
break
}
}
return |
When I run it, it finishes the first window (which I started with it in focus), but then goes to Firefox and clicks repetedly. However, it goes to the proper window when I press Win-R. Once it's done all of the windows it's supposed to, I get the "Done a loop" message. |
|
| Back to top |
|
 |
horntail
Joined: 03 Aug 2009 Posts: 69 Location: UK
|
Posted: Thu Sep 03, 2009 9:57 pm Post subject: |
|
|
| do you have any other windows open at the time which start with the name Supreme World:? |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Sep 04, 2009 3:04 pm Post subject: |
|
|
| No. The only windows that start with that name (as far as I know) are ones the macro is supposed to work on. |
|
| Back to top |
|
 |
horntail
Joined: 03 Aug 2009 Posts: 69 Location: UK
|
Posted: Fri Sep 04, 2009 3:50 pm Post subject: |
|
|
ty changing the winactivatebottom line to this,
Also, the coordmode line is not needed, cordmode defaults to what you've set anyway |
|
| Back to top |
|
 |
Temporary Guest
|
Posted: Fri Sep 04, 2009 4:08 pm Post subject: |
|
|
| "WinActivateBottom requires at least one of its paramemters." |
|
| Back to top |
|
 |
horntail
Joined: 03 Aug 2009 Posts: 69 Location: UK
|
Posted: Fri Sep 04, 2009 4:15 pm Post subject: |
|
|
then try
Or
| Code: | | winactivatebottom, supreme world: |
|
|
| Back to top |
|
 |
Temporary Guest
|
Posted: Fri Sep 04, 2009 4:27 pm Post subject: |
|
|
| I don't need help anymore. Changing the WinActivateBottom to just "WinActivate" worked perfectly. |
|
| Back to top |
|
 |
Temporary Guest
|
Posted: Fri Sep 04, 2009 4:28 pm Post subject: |
|
|
| And that post was supposed to go through before horntail's except I missed the second submit.... |
|
| Back to top |
|
 |
|