Can't get "The focussed window's title changed" to work

Hi, All,

The concept of my macro is reasonably simple: when the title of Microsoft Outlook's focussed window changes from "Inbox • ..." to "Searching 'Inbox'", I want KM to click the "All Items" button. Problem is, the macro never gets triggered. (I haven't had any problems with getting the button click to occur—just the trigger.)

I've also tried the option "The focussed window title changes" though I have no idea what the difference between the two options is.

In any case, the macro never executes.

Is the problem between the keyboard and the chair?

Thanks,
Bill

It is worth noting that the next step:

(after the debugging notification) responds correctly and changes from "(currently true)" to "(currently false)" as the window title changes.

Also worth noting that I do have Outlook at the fore when trying this out, so "(when Microsoft Outlook is at the front)" should be true, but I can't confirm that.

/Bill

This macro seems to work. Maybe it's a good starting point?

Outlook Search Window Detector.kmmacros (2.9 KB)

Also, added a Q in a different topic as to what those title-changes/changed triggers do.

Seems to work ok in Mail (you get multiple trigger events as Mail updates the message read count). Maybe Outlook does not play nice with accessibility, I don’t have Outlook I’m afraid, so I can’t test it.

Hi, all, and thanks for the help.

The problem appears to be related to having both Office 2011 and Office 2016 installed simultaneously. Though I don’t use the Outlook 2011 application anymore, somehow the macros which were once targeted to Outlook 2016 suddenly got retargeted to 2011. I.e., the “Available in these applications:” and “The front window of:” selectors were targeted to Outlook 2011. I can’t find a consistent behavior/misbehavior, but it works now that I’ve ensured that they all point to 2016.

iNik’s script started working immediately when I got to the office (thank you for including DropBox sync, Peter!) even though it was pointed at 2011, and now my scripts work, but only after I pointed the macro group at the proper application.

Like I said, I don’t have a definitive cause, but it seems to have something to do with multiple instances of apps with the same name and my macros’ not being pointed to the right one.

Thanks,
Bill

Keyboard Maestro remembers applications based primarily on path, and secondarily on bundleID.

As such, it will remember the application you select as long as the application remains at a fixed location. If the application is not there for any reason, then Keyboard Maestro will look for an alternative with the same bundleID.

If you are syncing your macros between different Macs, and they have applications in different locations, or some applications are installed on only some Macs, then you will run in to trouble.

1 Like

Thanks for the explanation, and good to know. I think I understand why things worked the way they do—the Mac at home only has 2011 on it. I’ll try to keep myself out of trouble and jettison Outlook 2011 now. (I keep the rest of the Orifice suite around because I never know when MS will break it horribly. The 2016 versions are, in a word, awful.)

An idea: If you have 2011 and 2016, just set up the macro to work in both applications. That should solve it.