Conflict hotkey triggers

Just getting started with KM, so forgive me if I've missed something! MacOS 14 Mojave.

One macro I have written uses alt-ctrl-shift-N as the trigger, and it works ok most of the time. It opens my Accounts app, clicks on a Natwest Bank button to go to that part of the database, & types Cmd-N to create a new entry in that bank account. I'm delighted with the macro, and it's very quick and useful.

But sometimes (tried it just now and this did NOT happen), after the Accounts app has opened but before it clicks the Natwest button, it or something opens a new instance of my default browser Google Chrome, and stops there - the 2nd part of the KM app does not happen. There is certainly nothing in my KM macro to do this!

This happens whether I'm using Chrome at the time (as I am now) or in the KM Editor, or e.g. in LibreOffice which I use regularly.

If I'm in Finder on my desktop (no Finder window open), then the error occurred just now, but when I repeated this, it did not occur, and Chrome did not launch!

I've also turned off the KM engine & tried the hotkeys from Desktop/Finder, and nothing happened (not surprising).

Finally, I've stepped through the macro using the debugger, and it worked ok with no Chrome starting.

Unfortunately, I've not been able to establish exactly when the error occurs.

The rest of this post is on a slightly different but related topic.

I had a look at the keyboard shortcuts already on my Mac in System Preferences / Keyboard, and as an experiment created a KM macro using Cmd-Alt-D as the trigger. That combination is one of the Mac keyboard shortcuts and shows or hides the Dock (I didn't know that until today). My new KM macro opens the Notes app. and types some text in it. I've found that when I type the trigger, the KM macro runs fully, AND the Dock is displayed or hidden, so the hotkeys are having a double effect. Is this something that can be avoided? It is potentially rather dangerous! Finding a key combination that does not already have an effect is rather difficult.

Try a trial version of KeyCue and see if that helps.
Also change some of your hotkey triggers and see if you still get the conflicts

Just a thought: because you are “driving” the user interface it might be worth inserting short Pause actions (say .2 or .3 seconds) between your existing actions in order to allow the OS to keep up with what KM is doing. I’ve personally noticed this kind of odd KM behaviour that happens unpredictably simply because KM is trying to do things too quickly. This has also been noted in many other discussions in this forum. Unfortunately, because it is unpredictable, you’ll have to use a trial and error approach to how many pauses you need and where they need to be inserted.

Many thanks for the suggestion. I'm trying KeyCue, but no luck so far - but there's a lot to look at so I'll persevere!

Thanks for the suggestion. It might well help, but with intermittent problems it's so difficult to be sure the problem is solved!! Keep testing.

For the best, most useful help, please upload your macro .

You might find this macro helpful to identify and debug your macros when you get an error:

MACRO: Display Last KM Macro Error Ver 4 [Pub]

This macro also makes it easy to display the last N lines from the KM Engine Log.

This strongly suggests that it is an UI timing issue.
When you use a KM Action that issues some UI command, like Type a Keystroke or Select Menu, KM has no idea how long it will take the target app to respond. And so KM immediately goes on to the next KM Action.
I almost always put a very short delay (like 0.1 sec) after such an Action. Sometimes it takes longer.
When you step through the Macro using the KM Debugger, carefully observe how long it takes the App to respond to each of these Actions.

Please read:
Tip: How Do I Get The Best Answer in the Shortest Time?

Many thanks for these helpful tips. I think this is a timing issue, as you suggest, and I'm experimenting further. One thing I've found is that a Pause of as much as 5 seconds is sometimes required when an app I need to open is needed, but on other occasions (e.g. if the app is open but has no window open), it only needs say 1 or 2 seconds. I'm looking into Pause Until, but the options available there don't seem to cover my particular case. Keep trying!