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 watch for any of multiple windows then send Enter?

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



Joined: 18 Mar 2008
Posts: 2

PostPosted: Tue Mar 18, 2008 4:42 pm    Post subject: How do I watch for any of multiple windows then send Enter? Reply with quote

I wrote the following script, that works great, but runs my CPU at around 50% continuously.

Code:
Process, priority, Low
Menu, Tray, Icon, %A_ProgramFiles%\AutoHotkey\Scripts\Compulsary_Bypass.ico
Loop
{
IfWinActive, Delete
Send, {Enter}
IfWinActive, Saved
Send, {Enter}
IfWinActive, Routed
Send, {Enter}
}


As you can see I have tried setting the process priority to low, but it didn't seem to make a difference.

I have 2 questions:

1) Is there a better way to get the same effect without the CPU strain?

&

2) Is there a command that makes the process hidden or not display in the system tray?

Thanks in advance!!!
Back to top
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1381
Location: USA

PostPosted: Tue Mar 18, 2008 4:54 pm    Post subject: Reply with quote

1) add a sleep inside the loop
2) #NoTrayIcon
_________________

ʞɔпɟ əɥʇ ʇɐɥʍ
Back to top
View user's profile Send private message
Firewolf91



Joined: 19 Oct 2007
Posts: 134
Location: PA

PostPosted: Tue Mar 18, 2008 5:29 pm    Post subject: Reply with quote

yea without a sleep in that loop, its like a hamster on speed running in a wheel and the loop is the wheel.
lots and lots of cycles per second. lots. hense high cpu.
Back to top
View user's profile Send private message
CJPrinter



Joined: 18 Mar 2008
Posts: 2

PostPosted: Tue Mar 18, 2008 5:58 pm    Post subject: Reply with quote

Embarassed Duh...I should have known that.

Thank you both sooo much!!! It's working perfectly now!
Back to top
View user's profile Send private message
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