WeirdBug in Variable Names? RTFM

I'm working on a macro that has a Prompt With List action at its core. So I created a variable to save the mouse location from right before the PWL is invoked, and I called it pwlMouseStartPos. The script kept dying at the point where it was using that variable. The debugger showed that I was not setting that variable, it started out as Password and stayed that way. Setting the value was glossed over by the KM engine, but when I tried to extract the X and Y values to use them, that's when it failed. That was just TOO weird. I noticed in the Action Window that the little notation at the bottom of the action showed that the value was Password before I had done anything to it.

So I started to put together a bug report, complete with screenshots. And then I thought to look up "password" in the manual.

On the "Variables" page, manual:Variables [Keyboard Maestro Wiki], I found:

Password Variables

Variables with names that start or end with “Password” or “PW” are considered passwords – their values will not be stored (except in memory) and they cannot be read directly by shell scripts or AppleScripts, though their consequences can easily be extracted, eg with the Set Clipboard to Text action, so you should clear them as soon as they have served their purpose. The Prompt For User Input dialog will display such variables concealed in a password field.

That explains it. Renaming all my pwl* variables fixed it.

1 Like

Good work. I empathize. Every language has pitfalls.

1 Like