Jump to content
Macro Express Forums

Windows Activation Question


patgenn123

Recommended Posts

Hi everyone.

 

Can anyone help me answer this question;

 

I have a program that I am having a really difficult time trying to "ACTIVATE" anything.

 

The properties Tab has 6 choices - 1)HotKey 2) Schedule 3) Shortkey 4) Window Title 5)Mouse Click 6) Control

 

When I use Window Title OR Mouse Click, it only triggers ONCE and then it no longer works again.

 

Window Title only works again when the Window Title is reactivated by either returning from another program or minimizing then maximizing it. WHY CAN"T it KEEP ON FIRING WHEN THE SPECIFIC PROGRAM WINDOW IS ACTIVE? It seems like the Window Title only works once and that's it. What makes Windows cause the Window to be active continuously?

 

Doesn't clicking on the screen cause that screen to be active again without having to go to another screen or minimzing/maximizing it and coming back?

 

With Mouse Click, it works, but it only works if SCOPE is global. Why doesn't it work when an additonal condition like SCOPE(Window Specific and Program Specific) is added to the mix?

 

Clicking on a certain area with Mouse Click won't work and is not consistent.

 

Is there a patch or something?

 

Thanks!

 

-P

Link to comment
Share on other sites

WHY CAN"T it KEEP ON FIRING WHEN THE SPECIFIC PROGRAM WINDOW IS ACTIVE?

 

You want it to run over and over again, as long as the window title is active? Put a REPEAT at the beginning and REPEAT END at the end. And somewhere in the logic, check for whether the window is (still) active and on top, and REPEAT EXiT if it is not. Otherwise it will never stop.

Link to comment
Share on other sites

Then that's the answer!

 

But I want to make sure I'm clear. Mouse click(in the Properties Tab)works, but if you add a Scope condition such as Window Specific or Program Specific, it doesn't work anymore.

 

What kind of repeat would you use then? Is it <> and if so, give me an example.

 

Just kind of frustrated. That's all.

 

-P

Link to comment
Share on other sites

It seems like the Window Title only works once and that\'s it. What makes Windows cause the Window to be

active continuously?

 

What rberq suggested would look something like this (with whatever modifications you might need specifically

for your situation):

 

Repeat Until %T1% <> %T1%
 If Window Title \"Specific Window\" is on top
   // Macro Code Here
 Else
   Break
 End If
Repeat End

 

<REP3:08:000002:000001:0001:1:01:T1><IFOTH:03:2:Specific Window><REM2:Macro Code Here><ELSE><BREAK><ENDIF><ENDREP>

 

If you read this before I edited it, sorry, I completely misunderstood the question the first time.

Link to comment
Share on other sites

Thanks Scaspar and rberg!

 

Can anyone, you, rberg etc, try to see if you are having the same problem as me?

 

Here it is:

 

Use Mouse click(in the Properties Tab) and choose an area/part and try it(keep the Scope global). Then add a Scope condition such as Window Specific or Program Specific, and see if it works.

 

The reason for my frustration is that Mouse Click(on an area) works only globally and not specfic to a Scope and that's where my confusion/frustration set in.

 

I was pretty upset because I was doing something big and it wasn't working at all.

 

Thanks!

 

-P

Link to comment
Share on other sites

Thanks Scaspar and rberg!

 

Can anyone, you, rberg etc, try to see if you are having the same problem as me?

 

Here it is:

 

Use Mouse click(in the Properties Tab) and choose an area/part and try it(keep the Scope global).

Then add a Scope condition such as Window Specific or Program Specific, and see if it works.

 

Hi Pat,

 

I built the following very simple macro and tested it thus:

 

  • In Region - Left: 702, Top: 2; Right: 1016, Bottom: 234

Scope Results

  1. I first selected Global
  2. Then I selected Window Specific (for the purpose of the test I used "Macro Express Forums as my
    specific window).

The Macro ran, as expected, when I clicked in the defined region. When set to Global, it ran on every

window I tested it on; when set to Window Specific, it only ran on the Macro Express Forums window.

 

I then ran a second test with the Repeat modifications shown in the second set of codes down below,

with similar results. The second set of code includes the repeat discussed in a previous reply, where

the macro runs continuously once started until the window in question is no longer on top (please note,

my test makes use of a text box which I have set to remain on top, but NOT keep focus - results may

vary with different settings).

 

TEST 1:

    Text Box Display: Hi, 
   Delay 1 Seconds
   Text Box Close: Hi, 

 

<TBOX4:F:6:CenterCenter000128000085:001:Hi, This is a test.><DELAY:1><TBCLOSE:Hi, >

 

TEST 2:

Repeat Until %T1% <> %T1%
 If Window Title "Macro Express Forums" is on top
   Text Box Display: Hi, 
   Delay 1 Seconds
   Text Box Close: Hi, 
 Else
   Break
 End If
Repeat End

 

<REP3:08:000002:000001:0001:1:01:T1><IFOTH:03:2:Macro Express Forums><TBOX4:F:6:CenterCenter000128000085:001:Hi, This is a test.><DELAY:1><TBCLOSE:Hi, ><ELSE><BREAK><ENDIF><ENDREP>

 

I'll run the test again with Window Title set as the launch, but I expect similar results. If I do experience

any unexpected problems, I'll be sure to post a follow-up.

Link to comment
Share on other sites

FOLLOW UP

Ok, I did have an unexpected problem, and by unexpected I mean that it isn't even what you had described.

 

When I set to Window Title as the Activation, the macro ran, and it ran right. When running with the Repeats,

it ran exactly as it should have; but when I ran it without the repeats, it ran once, finished, and I thought that

was fine, exactly what I expected... but when I changed the window to any other window, the Activation

Window (Macro Express Forums) pulled itself back to the front and the macro ran again. This would only

happen once. The next time I tried leaving the window, I was able to without getting yanked back. If I

manually returned to the ME Forums page, the macro would run, and pull me back again when I left the page...

again, just once. Very strange behavior.

 

However, based on the problems you've described I observe the following possibilities:

  • You're expecting a macro to run over and over without repeats when set to Window Title as Activation, and
    when that window remains on top.
  • There is a bug specific to your version or your computer that isn't affecting me (ME vers. 3.7d)
  • The windows you are selecting have a type-o somewhere (not likely if you're selecting from the Browse button)
  • Or Something else entirely that I didn't think of.

If it's the first one, I'm pretty sure ME is designed specifically not to run the macro more than once per

visit to the particular window in question. It would get VERY bothersome if you just needed the macro to run once

when a window came to the front, but kept going over and over and over. Especially since it's pretty simple to build

a repeat cycle into a macro to keep it going as long as the window is on top.

 

And yet, I wonder if an option in the Activation menu to auto-repeat as long as the window is on top would be a

good option for a future build of ME. Something to suggest, anyway.

Link to comment
Share on other sites

"... but when I changed the window to any other window, the Activation

Window (Macro Express Forums) pulled itself back to the front and the macro ran again"

 

SCASPER, I have a Citrix application that opens and closes (or doesn't close) half a dozen different windows, and each window has its own macro tied to the window title. What I have seen is, when the application switches from one window to another, one of the other windows may become "on top" for a brief instant and its macro will run again. It's an intermittent problem, it may work perfectly ten times in a row and fail the eleventh. I had to set variables indicating which window should REALLY be active; and the first thing each macro does is check whether it is really supposed to be running or not, and simply stop if it isn't.

 

I don't know whether you are seeing a similar phenomenon, and I'm not sure how to account for it happening only once. One theory for the "once only" is that it is a caching issue -- that is, the first time you switch to another window, the related programs and data may have been paged out of memory, and during the page-in time the original (macro-activating) window briefly gains focus again. The next time you switch perhaps everything is in core and the switch happens cleanly. I would be interested to know whether your extra macro runs are 100 percent consistent, or intermittent.

Link to comment
Share on other sites

"... but when I changed the window to any other window, the Activation

Window (Macro Express Forums) pulled itself back to the front and the macro ran again"

 

SCASPER, I have a Citrix application that opens and closes (or doesn't close) half a dozen different windows, and each window has its own macro tied to the window title. What I have seen is, when the application switches from one window to another, one of the other windows may become "on top" for a brief instant and its macro will run again. It's an intermittent problem, it may work perfectly ten times in a row and fail the eleventh. I had to set variables indicating which window should REALLY be active; and the first thing each macro does is check whether it is really supposed to be running or not, and simply stop if it isn't.

 

I don't know whether you are seeing a similar phenomenon, and I'm not sure how to account for it happening only once. One theory for the "once only" is that it is a caching issue -- that is, the first time you switch to another window, the related programs and data may have been paged out of memory, and during the page-in time the original (macro-activating) window briefly gains focus again. The next time you switch perhaps everything is in core and the switch happens cleanly. I would be interested to know whether your extra macro runs are 100 percent consistent, or intermittent.

 

That's probably it. I was at work when I was having that problem, now that I'm home I'm not able to duplicate it. We use Citrix at work for some stuff, so maybe it was misbehaving.

Link to comment
Share on other sites

That's probably it. I was at work when I was having that problem, now that I'm home I'm not able to duplicate it. We use Citrix at work for some stuff, so maybe it was misbehaving.

 

Misbehaving, or "working as intended", as a practical matter it doesn't seem to be an issue except when running software like ME that "sees" the window that a human would never notice. I don't know if it is Citrix-related or Windows-related. I'm testing macros now with a somewhat similar web-based application, so I expect I will find out! Thanks for the feedback!

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