List Prompt + Switch Case Not Working

I'm losing my mind a bit with KM as it seems sometimes it works, then I elaborate a macro, and it all breaks. Going back to the simplest thing ever, I can't get a list prompt + switch to work and I'm lost:

The end game is to use the switch case to set a bunch of variables that will populate a big insert at the end. But baby steps: any idea why this always pastes the "empty" case no matter which option I choose?

It is always best to upload both your Macro image and file so that it is easy for us to test.
See How to upload your macro. Instructions for uploading to an existing post are just below the main instruction.
You may also find this Macro useful: MACRO: Upload KM Macro to New or Existing Topic @KM [Pub]

Just looking at your macro image, it looks fine to me.
The only reason I can see why it would paste the "empty" case is if you did NOT choose any of the items in the List. You can easily determine this by opening the KM Preferences > Variables pane and examine the Variable "NoteProjectTab".

Thanks for the reply and pointer (first post and didn't know about the awesome built-in posting feature of KM). Here is the macro:

New templated note — Work Meeting.kmmacros (4.9 KB)

You can easily determine this by opening the KM Preferences > Variables pane and examine the Variable "NoteProjectTab".

Is that supposed to fill in dynamically? When I select an option from the list prompt, with Variables pane open and the NoteProjectTag variable selected, nothing happens and I get my "empty" case.

I think you are not properly selecting the Project from the List.
After you select it, you MUST press RETURN.

You macro works fine for me:

Demo-Users-Macro-Switch-Case-AN

Thanks for the time to post the vid; clearly it works. What's weird is with the new day today and power cycle of computer, it's working for me too now! When I first saw your post I thought maybe it was because I was using keyboard only to select from list but it works now either way.

I also noticed some other macros where a KM variable is being passed to Apple Script that were giving an "error of type -4960" yesterday (made note to troubleshoot when I had time) are now working again today. So, are there any known bugs where KM variables fail until reboot?

Valuable lesson learned: When your Mac starts acting weird, the first line of troubleshooting is to restart the Mac. You may be surprised how often this fixes a mysterious problem.

Don't really know what you mean by that, but in general I have found KM to be a very solid, stable, robust app. Bugs and inconsistencies are very rare.

To be candid, most weird problems are some type of user error and/or misunderstanding. That is excepting, of course, the security and accessibility issues that started with macOS Mojave, and have gotten worse with each new release.

Debugging

One very important skill to learn with any programming tool, and KM is a programming tool, albeit a visual one, is debugging. This means finding bugs in your code (Macro Actions) and design, not in the tool itself.

Some Key Debugging Techniques

  1. To inspect Global Variables, use the KM Preferences > Variables panel and/or the Window > Value Inspector
  2. Use the Display Text In a Window Action at key places in your Macro to show values of all types of Variables.
  3. Use the Macro Debugger to step through your macro to observe which branches it takes, and to view data from #1 at each step.

Thanks for your helpful reply. My experience with KM has also been one of robustness thus I never thought to power cycle to fix the behaviour, especially as there was no error message; I assumed it was user error.

I had the same issue happen today, where variables across KM failed silently. Force quitting KM Engine and relaunching fixes it so at least I don't have to close everything to restart. I don't know yet what is causing it so seems a bit vague to report.

Some Key Debugging Techniques

Thanks for those tips! Two of the three are new to me so that's valuable info.

What does that mean "variables failed silently"?
Do you mean "Macros"?

Sorry if you have already posted this, but please post the versions of KM and macOS you are running.

Also, see Troubleshooting -- KM Wiki.

Error -4960 is coreFoundationUnknownErr.

That is an unusual and weird error to get.

So my guess is your Mac is getting messed up by something, and then Keyboard Maestro is suffering because of that.

You should never have to force quit Keyboard Maestro or Keyboard Maestro Engine, and while yes, there are very occasionally bugs, none of this sounds anything like a Keyboard Maestro bug, it sounds like your system is messed up. As to what is causing it and what other things may be happening, that is very hard to guess at.

It has just happened on a different computer: I have to quit KM Engine and restart for the variables to not return empty. It still could be something messed up but it is trickier now that it is on two systems, one having been freshly re-installed a month ago.