Jump to content
Macro Express Forums

Question regarding Controls


junq

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Cory
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...