Simple macros fail to end (until they time out)

I'm using KM 8.0.3 on macOS Sierra 10.12.6 on a 2017 iMac, 4.2 GHz Core i7, 32 GB ram.

I've been getting a lot of strange behavior from my macros in the past week or so, but one that I'm seeing fairly consistently is with some simple macros which activate an app. Each macro has just a single step, activated by a hotkey

The macro runs and activates 1Password, but when I click on another app, 1Password is immediately re-activated. This continues for about 5 seconds, at which point I get a notification that the macro has timed out, and then things return to normal.

But it's not just a 1Password issue - a similar macro which activates Geany has the same issue.

Besides being dead-simple, I've been using these for a couple of years. Rebooting seems to solve the problem for a little while, then it comes back. And not all of my activation macros have this issue (even though they're virtually identical to the 1Password one). Also, it doesn't seem to be an issue on my Macbook Air running High Sierra.

I don't see any other posts which would indicate this is a general problem, must be something unique to me ... but how do I find out what's going on?

Thanks.
LarryA

Sounds like your macro is being triggered by something other than just the one hotkey.
Please upload your complete macro, so we can be of more help.

See

Thanks for your help, and here's the macro (in both forms):

Open 1Password 6.kmmacros (1.8 KB)

You'll no doubt notice that is now says 1Password 6 instead of 1Password 5 ... but the problem remains the same, and even when it said 1Password 5, it was launching 1Password 6.

LarryA

The only reason that the macro is hanging on the Activate 1Password 5 or 6, is that I cannot find that app.

What happens when you try using Mac Spotlight to activate/launch 1 Password?

Check the KM Engine Log to see what macros have recently been triggered.
In the KM Editor menu, goto Help > Open Logs Folder, then double-click on the Keyboard Maestro Engine log file. Scroll to the bottom and examine the last 10 or so macros that were triggered, and if there are any errors.

Make sure KM, and all your apps, are in the Mac Applications folder.

Also, make sure you don't have BOTH 1PW 5 and 1PW6 apps installed. That could lead to confusion.

Opening 1Password 6 from Spotlight works fine, and there is no 1Password 5 app in my Applications folder (and that is where 1Password 6 is installed, as is Keyboard Maestro)

Here’s what I found in the engine log file from the last time I had a problem running the macro (you can see that I had changed the macro to run 1Password 6 but hadn’t yet renamed the macro):

2017-10-17 09:56:41 Execute macro “Open 1Password 5” from trigger The Hot Key ⌥⌘1 is pressed
2017-10-17 09:56:45 Running application query took a while (3011 us)
2017-10-17 09:56:53 GetProcessForPID(2657) failed with -600 for <KBMRunningApplication “1Password 6” <0x6080000e9000> pid=2657 bid=com.agilebits.onepassword4 abht>, using cached version
2017-10-17 09:57:01 Action timeout exceeded. Macro “Open 1Password 5” cancelled (while executing Activate 1Password 6).

Thanks again for helping me with this.

Larry

Looks like it is trying to access an old version, 1PW4.

In your action, delete the existing app to activate, and reselect 1Password 6.

You might also do a Spotlight search for "1Password" and see if any of the older versions show up, like 1 Password 4.

1Password 5 and 6 also use the bundle ID com.agilebits.onepassword4.

Basically, what is happening is that Keyboard Maestro is activating 1Password, but then it cannot get the process for 1Password (pid 2657).

You could run the Terminal command:

ps axuwww | grep 1Password

to see if there are multiple entires or something else odd going on.

Otherwise, the issue is simply that the system is not returning the right information (which sadly, for anything related to NSRunningApplications is entirely likely).

Restarting your Mac may clear it up.

A sledgehammer workaround is to simply set the action to have a short timeout and no reporting of issues.

@LarryA, I just setup and run this macro, and it completed instantly.
I got the notification as soon as 1PW6 was activate/frontmost.

I'm running Keyboard Maestro 8.0.3 (8.0.3) on macOS 10.11.6.

Thanks to both of you for your suggestions! Since the last reboot the problem has gone away, but I expect it’ll return. I’ll post more info when that happens.