Yikes! New 7.1 “Search Variable/Clipboard actions now fail if the match fails” feature has massive repercussions

I read the 7.1 release notes. I saw the line:

Search Variable/Clipboard actions now fail if the match fails.

and I thought that sounded pretty good.

But I wasn’t thinking about the tons of macros I have that search variables and then do something if the search-term is found. Now instead of not doing the thing, the whole macro fails. I can work around this, of course, but it’ll take hours to find everything. In the meantime, I’ve dropped back to 7.0.3.

Think about whether you might be in a similar situation before upgrading to 7.1!

Yes, I hit this myself with more than a couple macros. But it is still the better behaviour. The reverse means your macro just silently fails and its entirely unclear what happens to the variables in that case.

Again, for me, I just fix up the macros when the failure happens, making sure to check the macro and ensure that it behaves correctly in that case. The recently triggered button at the top of the editor makes getting to the macro very easy.

And unfortunately, reverting back to 7.0.3 won’t be of much use since then you cannot adjust the settings on the actions to turn off the abort/notification on the failure, so there is no way to move forward at that point.

In case people are not clear on this issue, it only applies to the Search Variable and Search Clipboard actions. For example, this:

Before 7.1, this sequence would report no issues, but First and Last variables would be left unchanged. So for example if this was a loop, or used multiple times, and then someone had a name with only one word, the macro would end up just using the first and last name from the previous person. Obviously this could be highly undesirable if you didn't notice.

So for 7.1, that second action will now fail and notify you of the failure.

So you need to decide how to handle it. Perhaps it really is an error and should not have been allowed to happen at all. Perhaps you just need to set some defaults:

and then turn off aborting and notification of the error:

But as much as this might occasionally be a nuisance in converting to 7.1, the alternative would be silently doing a potentially disastrous thing which is much worse.

Peter, do we have any control over the notification?

Currently it is a very brief popup, that could easily be missed:

It is very informative, but is too brief, and provides NO sound.

Are there any options/preferences to customize these "Action Failed" notifications, like with:

  • Add Sound
  • Stay visible until closed

It took me 3 more KM Actions to build my own notify that does this:

MACRO: Search Variable/Clipboard Fails IF NO Match [7.1]

Search Variable-Clipboard Fails IF NO Match [7.1].kmmacros (3.2 KB)

which produces this:

BTW, it should be mentioned that you can turn TURN OFF the Action Failure:

Nope, it's a standard notification.

Apple's Notification Center is not Growl - it does not allow applications any control. I can't even create notifications that have buttons or respond to being clicked (unless they all have buttons for example). It's a pretty silly system.

However, the notification does not just disappear, it is probably shown in the notification center (though there again, the behaviour is largely insane as far as I can see - actually it looks less insane in 10.11, maybe they improved it).

The notification is also recorded in the Engine.log file. And, as I mentioned, you can click on the Recently Triggered button at the top of the Keyboard Maestro editor window to go directly to the macro.

Keyboard Maestro could obviously beep itself, but that would then require yet another level of control since it generally would not be desirable.

There are some controls in the Notifications system preference.

Thanks for the responses, everyone.

Peter, you wrote:

I do understand what you’re saying, but that has not been my experience. I stopped the engine, replaced 7.1 with 7.0.3, and my macros are once again acting just as they always have before.

BTW, for the record, I do understand that the new method is superior; in the long run, I will probably thank you for the change.

My only problem (and, I suppose, complaint — although you did clearly state the new behavior in the release notes, so really the onus is on me here) is that I really can’t afford to “fix up the macros when the failure happens, making sure to check the macro and ensure that it behaves correctly in that case.” Most of my macros are fairly complicated and they work in a semi-automated environment on a server.

I designed my macros around the way the Search Variable demonstrably worked, not around the Platonic ideal of a Search Variable action. And in fact, most of the time if what I search isn’t found, then an empty result variable is exactly what I want. (Yes, I always delete all of my macro’s variables at the end of a loop, group, if/else, or of the macro itself, other than state-saving variables.)

The fix isn’t too terrible: if I un-tick both “Failure Aborts Macro” and “Notify on Failure” for each Search Variable step, I believe I’ll have the original functionality.

tl;dr: I guess it’s just that — since my updates from Keyboard Maestro 3.x to 4.x to 5.x to 6.x to 7.x have never once caused a macro to work in a new way (let alone to stop working altogether!) — I just really didn’t expect such a result going from 7.0.3 to 7.1, and I wanted to warn others who might be in a similar situation.

Thanks for always making Keyboard Maestro the best you can; that’s always appreciated, even though it’s going to cause me a few hours’ work this time.

— Erik

Yes, I do generally try pretty hard to ensure both that changes do not break existing macros and also that you can revert to a previous version and keep your macros intact. Both within reason.

Occasionally it is difficult to make a change that is warranted without compatibility issues. 7.1 actually had two, this one and the change to using the full path in the Folder Trigger.

In this case, I didn’t see any other way to do it, since the issue was that there was a potential bad behaviour that was waiting for unwary users. I would suspect only a small percentage of people are diligent at clearing variables.

Sorry for the hassles, but hopefully it saves you from something worse one day.

1 Like