| View previous topic :: View next topic |
| Author |
Message |
CJPrinter
Joined: 18 Mar 2008 Posts: 2
|
Posted: Tue Mar 18, 2008 4:42 pm Post subject: How do I watch for any of multiple windows then send Enter? |
|
|
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 |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1381 Location: USA
|
Posted: Tue Mar 18, 2008 4:54 pm Post subject: |
|
|
1) add a sleep inside the loop
2) #NoTrayIcon _________________
ʞɔпɟ əɥʇ ʇɐɥʍ |
|
| Back to top |
|
 |
Firewolf91
Joined: 19 Oct 2007 Posts: 134 Location: PA
|
Posted: Tue Mar 18, 2008 5:29 pm Post subject: |
|
|
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 |
|
 |
CJPrinter
Joined: 18 Mar 2008 Posts: 2
|
Posted: Tue Mar 18, 2008 5:58 pm Post subject: |
|
|
Duh...I should have known that.
Thank you both sooo much!!! It's working perfectly now! |
|
| Back to top |
|
 |
|