AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help with loops/ifs? (Trying to run programs in sequence)

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Temporary
Guest





PostPosted: Thu Sep 03, 2009 7:07 pm    Post subject: Help with loops/ifs? (Trying to run programs in sequence) Reply with quote

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

PostPosted: Thu Sep 03, 2009 9:57 pm    Post subject: Reply with quote

do you have any other windows open at the time which start with the name Supreme World:?
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Sep 04, 2009 3:04 pm    Post subject: Reply with quote

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

PostPosted: Fri Sep 04, 2009 3:50 pm    Post subject: Reply with quote

ty changing the winactivatebottom line to this,
Code:
winactivatebottom


Also, the coordmode line is not needed, cordmode defaults to what you've set anyway
Back to top
View user's profile Send private message
Temporary
Guest





PostPosted: Fri Sep 04, 2009 4:08 pm    Post subject: Reply with quote

"WinActivateBottom requires at least one of its paramemters."
Back to top
horntail



Joined: 03 Aug 2009
Posts: 69
Location: UK

PostPosted: Fri Sep 04, 2009 4:15 pm    Post subject: Reply with quote

then try
Code:
winactivate

Or
Code:
winactivatebottom, supreme world:
Back to top
View user's profile Send private message
Temporary
Guest





PostPosted: Fri Sep 04, 2009 4:27 pm    Post subject: Reply with quote

I don't need help anymore. Changing the WinActivateBottom to just "WinActivate" worked perfectly.
Back to top
Temporary
Guest





PostPosted: Fri Sep 04, 2009 4:28 pm    Post subject: Reply with quote

And that post was supposed to go through before horntail's except I missed the second submit....
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group