junq Posted February 23, 2008 Report Share Posted February 23, 2008 Hello MacEx Community. I have an application which pops up from time to time. When the application pops up, I have to press a certain key. I've tried to use Controls, when the Window has Focus / is on Top, send the key. My problem here is, that it sends the key over and over again, adding a "Macro Stop" in the Macro Editor didn't help. Another problem is, that when I leave the PC, and the window Pops up again, it should again send the designated key. There is a Control in the application which changes each time it pops up, but I wasn't able to work out how to use this correctly unfortunately. In the Helpfile or Tutorials I unfortunately haven't found anything that would help with this problem. Would anyone have any insight, how to tackle this problem? Any help would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
Cory Posted February 25, 2008 Report Share Posted February 25, 2008 The only thing I can think of is that the macro is reactivating over and over because whatever you are using for activation is still apparent. This is why the Macro Stop doesn't do anything because it just fires up again at the end of the macro. You might add a pause so you can see what happens after toy press the key and then figure out how to add a delay or whatever you need to avoid the reactivation. Quote Link to comment Share on other sites More sharing options...
junq Posted February 26, 2008 Author Report Share Posted February 26, 2008 Well, that's the problem. Because the statement for the macro to activate will stay true when I'm not at the keyboard - because the window stays in front. That's why I thought with going when the content of a control changes - but i'm totally at a loss here on how I'd go about that. Quote Link to comment Share on other sites More sharing options...
Cory Posted February 27, 2008 Report Share Posted February 27, 2008 (edited) I just realized I'm being stupid, let me start again. If you choose to activate by window title that means the macro will fire when the window gains focus but it will only fire once. For instance I have a macro with "Calculator" window activation. If Calculator opens it runs once and only once. But if I click on a button it kind of refreshes the window and has the same effect as refocusing causing the macro to fire again. But if I install a 100mS delay after the button click the macro doesn't see this event. With the macro below I was able to fire only once and press the "7" key. Without the delay it fires over and over. <BEEP><GETCONTROL:01:CALCPLUS.EXE:002:SciCalcCalculator PlusButton7><CCLICK:T:01:0:T:><MSD:100> Edited February 27, 2008 by Cory Quote Link to comment Share on other sites More sharing options...
junq Posted February 28, 2008 Author Report Share Posted February 28, 2008 Thanks, I'll try if this works and get back to you about it 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.