digichaos Posted September 22, 2006 Report Share Posted September 22, 2006 I am using the Wait Window Lose Focus ability but it doesnt seem to use the functionality that I would like. I basically want the Wait Window lose Focus function to wait 30 minutes for the window to lose focus and if it has not, continue with the macro. But it seems that if the 30 minutes are up... the macro aborts. That really doesn't seem logical to me. I didn't tell it to abort... so it shouldn't. Is there any way around this? Quote Link to comment Share on other sites More sharing options...
jason Posted September 22, 2006 Report Share Posted September 22, 2006 The Wait For Window Title command has two options. One is to wait indefinitely, and the other is to wait for a certain time period. If you wait indefinitely, the macro will wait until the window has lost focus even if it is several days. If you wait for a time period, the macro will abort if the condition is not true. Instead you should try using the If Window Title On Top and If Not Window Title On Top commands in a repeat loop. Below is an example of the code that I used to test the condition. You will need to modify the delays to fit your time allotment. Repeat Until %N1% = 60 Delay 10 Seconds If Not Window Title "notepad" on top Text Box Display: Test // The break command will exit out of the loop if the Window loses focus, otherwise // it will continue on until %N1% = 60 Break End If If Window Title "notepad" is on top OR If Variable %N1% = 60 Text Box Display: Test End If Variable Modify Integer: %N1% = %N1% + 1 Repeat End Quote Link to comment Share on other sites More sharing options...
digichaos Posted September 22, 2006 Author Report Share Posted September 22, 2006 Thanks alot. That will probably work pretty well. Which part of this macro determines the amount of time to evaluate this? - Repeat 60 times? - Delay 10 second? - or Both in conjunction (IE: repeat 30 times and delay 60 seconds = 30 minutes)? Quote Link to comment Share on other sites More sharing options...
jason Posted September 22, 2006 Report Share Posted September 22, 2006 It is both. If you wish to monitor it for up to 30 minutes, you will need to make sure that the time and repetitions equal 30 minutes (e.g. delay 1 minute = 30 cycles, delay 30 seconds = 60 cycles etc...). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.