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 

How Do I Minimize A Loop to a single instance per window?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
john tuomi



Joined: 22 May 2006
Posts: 67

PostPosted: Fri May 09, 2008 5:48 pm    Post subject: How Do I Minimize A Loop to a single instance per window? Reply with quote

Greetings!

I am trying to right a script that looks for a specific window name, and when it finds that window, enter a word (In this case, APT), and then not send APT until a new window bearing the same name appears.

I tried using a sleep command to halt the loop until the person has had a chance to exit the screen, but that doesn't seem efficient.

Any ideas?


Code:
Loop
{
IfWinActive Document1 - Microsoft Word
Send, APT
sleep,10000

}
Back to top
View user's profile Send private message
poetbox



Joined: 07 Jan 2007
Posts: 59

PostPosted: Fri May 09, 2008 5:53 pm    Post subject: Reply with quote

sleep is not a good idea,just check the title(=)&HWND(<>)
Back to top
View user's profile Send private message
john tuomi



Joined: 22 May 2006
Posts: 67

PostPosted: Fri May 09, 2008 5:55 pm    Post subject: Reply with quote

I don't understand. Do you know where I can find that in the documentation?
Back to top
View user's profile Send private message
sinkfaze



Joined: 19 Mar 2008
Posts: 140

PostPosted: Fri May 09, 2008 7:29 pm    Post subject: Reply with quote

Maybe you could try using SetTimer with your loop.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   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