Open FOLDER Test Sample Macro (v11.0) - Only Works Sometimes

Open FOLDER Test Sample Macro (v11.0)

Currently I have an issue with a simple macro that opens a particular folder and then sets a variable to the finder insertion location and then displays text briefly on the screen of the variable.

Triggering this macro seems to open the destination folder every time with no problem. However displaying the variable sometimes comes up blank and sometimes shows the proper finder insertion location.

It seems it should always work?

I added pause until conditions are met action and it still does not work every time.

I'm wondering how I can improve the script so it works 100% of the time. Any ideas?

Open FOLDER Test Sample.kmmacros (3.2 KB)

I'm contemplating your question, but I have a question. Does your Pause action have any modifications to its timeout values? Or is it still set to the default of 99 hours? There are certain cases where this could be an issue if you changed these settings.

Same thing here when testing for you. With or without pauses, sometimes I get blank.

I notice that the result in the Editor for Set Variable to %FinderInsertionLocation% Action flashes between the actual finder location and blank. I don't recall if this is typical behavior, but I wonder if it's related.

EDIT: Just tested an existing macro that contains %FinderInsertionLocation% and had the same problem with random blanks instead of actual path. Has always worked fine in the past. Maybe @peternlewis can chime in when he comes up for air.

I will infer from your answer that you didn't modify it. That's fine. I'm still pondering.

I'm testing my own version of your macro (my version is written a bit differently to make testing easier) and I'm not getting any blanks. So maybe there's a problem with your exact code, since mine works. I will now try duplicating your code to see if I can get a failure.

Odd. Works fine here, consistently. I'm on Ventura FWIW.

I have a theory, (half of my theories are wrong) based on the fact that your macro doesn't have a trigger. My theory is that you are triggering the macro by clicking on the "Try" button at the bottom of the editor. The problem is that sometimes you are clicking on the macro name before you click "Try" and sometimes you are clicking on an action in the macro before you click "Try". In the past I've made this very mistake myself and it would result in a similar result to what you are now experiencing.

So the question for you is, how are you triggering this macro and could my theory be correct? Try using a hotkey to trigger the macro instead of the "Try" button.

EDIT: I just noticed that I falsely assumed it was the same person in both posts talking about the problem. Either way, my question stands.

Thanks to all for checking. I am currently on Monterey 12.7

Also I tried both with and W/O set action Timeout

I was triggering it for the run button on top. I added a hotkey - and the issue persists.

Okay, I accept that response. It was worth the interrogative. And I'm still testing.

Using your method, I can't get it to fail after ten tries. (And my own version of that macro I've tested 20 times, without a failure.) And I'm on Sonoma 14.0.

Without a failure, all I can do is speculate that something in your configuration is the issue. But I don't know what it would be. I would suggest turning off any possible conflicting "system utilities" or apps and trying again.

Rebooting, also, shouldn't be a "fix", but I recommend that too.

If none of that works, you could try this, and then test:

You mentioned that Peter could investigate, but he may not be able to replicate the problem, and if you have the problem now, then we know you (or dealtek) can do this sort of testing.

1 Like

Thanks for the suggestions - I will give them a try.

I did try this macro on another computer running Monterey 10.7 and KM v10.2

The issue does not happen here. Maybe it might have something to do with Monterey and KM v11?

1 Like

Are you folks testing this with KM v11 or an earlier version?

I'm on KM v11.

Your theory that it might be a combination of KMv10.2 and Monterey 10.7 gives the KM developer something very specific to work with. Perhaps the tests that I mentioned will help you confirm a more specific configuration that corresponds to the error.


@peternlewis is aware of this issue.

1 Like

What version of macOS? I believe this happens pre-Ventura (not sure how pre…)

Seems to be so. Machine with Monterey flashes, Sonoma does not.

1 Like

Quick update : I just updated from mac os 12.7 to 12.7.1 and can confirm that the issue still persists and also I see the flashing as described

This happens in pre-Ventura. It is fixed for the next version of Keyboard Maestro.


Thanks so much Peter - this seems to be working well after the update!

1 Like