rberq Posted September 30, 2009 Report Share Posted September 30, 2009 I have a macro whose scope is global. It is activated by window title XXX. It simply loops, recording the current time, as long as window XXX is on top. Variable Set String %T89% "0" Repeat Until %T89% = "1" [get current time and record in environment variable] If Not Window Title "XXX" on top Variable Set String %T89% "1" End If Delay 100 Milliseconds Repeat End // Variable Save All Variables // Macro Stop Window XXX contains a number of drop-down lists. When the user opens a list, (1) the list becomes the on-top window as far as ME is concerned, and the macro recognizes that and exits (2) the user selects from the drop-down list (3) the list closes, making XXX the on-top window again, and the macro begins running again (4) the application very quickly opens window YYY on top of XXX, based on the selection from the drop-down list, while the macro is still running (5) FOR SOME UNKNOWN REASON, window XXX apparently regains focus, which is recognized by the application (not the macro), and the application closes window YYY (bad!) If I increase “Delay 100 ms” to a longer delay, then everything works fine – window XXX does NOT regain focus after window YYY opens, so window YYY remains open. It is somewhere around “Delay 700 ms” that the problem disappears. Yes, I know it makes no sense. Ideas, anyone? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.