Jump to content
Macro Express Forums

Auto Stop Macro When Program Is Out Of Focus?


TsunamiZ

Recommended Posts

Is it possible to auto stop a playing macro when program is out of focus? Would be safer than having the macro continue to play keys beyond the desired program.
We are considering adding the ability to automatically pause a macro if a Window loses focus. Our Keyboard Express product has this feature.

 

In the meantime, what I do in my macros is to see if the Window has focus and give it focus if it does not. Something like this:

If Not Window Title "pgmacros.com" on top
 Activate Window: "pgmacros.com"
End If

Link to comment
Share on other sites

When I write my macros... they usually travel amongst screens in IE. So, At points where the screen changes... I do this:

 

Repeat Until %T1% <> %T1%

Variable Set String %T70% from Window Title

If Variable %T70% contains "CSR"

Break

End If

Delay 1 Seconds

Repeat End

 

This will send the Macro into an infinite Loop until the Window it is looking for is focused.

Link to comment
Share on other sites

When I write my macros... they usually travel amongst screens in IE. So, At points where the screen changes... I do this:

 

Repeat Until %T1% <> %T1%

Variable Set String %T70% from Window Title

If Variable %T70% contains "CSR"

Break

End If

Delay 1 Seconds

Repeat End

 

This will send the Macro into an infinite Loop until the Window it is looking for is focused.

But you won't be able to use a macro in another program until it resumes right?

Link to comment
Share on other sites

Is it possible to auto stop a playing macro when program is out of focus? Would be safer than having the macro continue to play keys beyond the desired program.
We are considering adding the ability to automatically pause a macro if a Window loses focus. Our Keyboard Express product has this feature.

 

In the meantime, what I do in my macros is to see if the Window has focus and give it focus if it does not. Something like this:

If Not Window Title "pgmacros.com" on top
 Activate Window: "pgmacros.com"
End If

Thanks for the idea (and cyberchief, too) since I have panicked when I occasionally lose focus and the macro runs "wild" in the wrong window. I guess I should put this kind of check in each of my macros.

Link to comment
Share on other sites

problem with that is when a window unexpectedly pops up -

such as microsoft's "do you want to restsart now, your updates are installed", or AVG virus' "do you want to start testing now...", etc.

 

actualy, a parameter that states "ONLY use in this window" would be helpful...

 

Each answer creates its own questions... but worth looking at..

 

thanks

Nick

Link to comment
Share on other sites

  • 2 months later...
  • 7 months later...
  • 6 months later...

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...