Jump to content
Macro Express Forums

Does windowspecific macros continue?


Recommended Posts

Does windowspecific macros continue if the active windowtitle changes?

 

I wanna start a macro windowspecific but within the macro running another window (intented) gets the active window. Does the macro stops?

 

It seems to, but i want it to continue. How is this possible without loosing the windowspecifiness at macrostart?

 

Thank You

Alexandra

Link to comment
Share on other sites

The Scope setting of a macro affects the activation of that macro, not what happens once it is running. If a program comes up and a window specific macro starts, that macro will run to the end.

 

You may have to deal with timing issues when the second window comes up. For example, use the Wait for Window command to make sure the other window is all the way loaded.

 

Also, sometimes Windows loads another program window but does not give it focus. When this occurs you need to add special commands to your macro. I use the Window Activate command in those situations.

Link to comment
Share on other sites

Thank you Kevin for the quick answer.

 

I thought so. It makes sense. My problem was that another macro which was programspecific was enabled. What actually happens if you have two macros one programmspecific the other one windowspecific but using the same program?

 

To me it would make sense that the windowspecific is prefered to run. But it´s not that way, or?

 

Thank You

Alexandra

Link to comment
Share on other sites

What actually happens if you have two macros one programmspecific the other one windowspecific but using the same program? To me it would make sense that the windowspecific is prefered to run. But it´s not that way, or?

I would expect both macros to run unless you do something special to prevent it.

Link to comment
Share on other sites

i´m almost sure that in the description of MEX it says: "Only one macro can run at the same time."

You are posting in the Macro Express Pro forum. Macro Express Pro can run more than one macro at a time. Are you using Macro Express 3?

Link to comment
Share on other sites

Sorry Kevin, i was not precise.

 

I do use MEX Pro. Actually i did forget that MEX Pro is capable of running more than one macro at the time. I admit i have no idea how this works. One after another? :rolleyes:

That may cause the problem.

 

I have the following scenario. I have a lot of programspecific macros with certain hotkeys like ALT + E for example.

 

I do want those to work but want to have some other specific macros to run instead if the program has this specific window title.

 

What is the most efficient way to do this? Of course i could code an "if window-title"-check into the programspecific macro but than i would have two macros in one which i find confusing.

 

I guess a kind of option in the settings like "prefer windowspecific scopes over programspecific" would be good. It would minimize the effort. Only the few exceptions would have to be programmed and you would save hotkeys which i am running out of lately. At least easy to press and to memorize ones. :lol:

 

Thank You

Alexandra

Link to comment
Share on other sites

I have the following scenario. I have a lot of programspecific macros with certain hotkeys like ALT + E for example.

 

I do want those to work but want to have some other specific macros to run instead if the program has this specific window title.

 

What is the most efficient way to do this? Of course i could code an "if window-title"-check into the programspecific macro but than i would have two macros in one which i find confusing.

Suppose you have 2 macros, M1 and M2, where both run with ALt-E and where M1 is global, M2 is program specific. Remove M2's Alt-E activation, and put your If Window Focused test for the M2 window at the beginning of M1. If the window is focused, simply have M1 call M2 and exit M1. I don't think that's so complicated. When M1 calls M1, have M1 not wait for M2 to complete.

 

You could even automate this. Instead of M1 and M2, call them M1 and M1 [xxx], where xxx is the name of the window you're checking for focus. Now, in M1, simply check for the existence of macro M1 [xxx] and call it if it exists, otherwise continue with M1. You could use this approach for all macros which have both specific window and global hotkey activation.

Link to comment
Share on other sites

is this true for my scenario too? I never mentioned global macros but programspecific vs windowspecific ones.

I've tried this example:

- Macro M1 global, Ctrl-Shift-K

- Macro M2 notepad window specific, Ctrl-Shift-K

- Macro M2 notepad program specific, Ctrl-Shift-K

 

I am unable to get more than one of these macros to run when Ctrl-Shift-K is pressed:

- if notepad is not running, M1 fires

- if notepad is running and focused, m2 starts

- in order for m3 to start, m2's scope is changed to, say, xnotepad

 

If these observations are correct, then I think that answers your question. Do you experience the same sequence of events?

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