###Bug or Feature in KM Variables used as Passwords?
I'm seeing unexpected behavior when I get a KM variable using AppleScript, where the variable was used in a password form field in the Custom HTML Prompt.
KM is returning "Password" instead of the actual variable value.
But KM shows the correct value in a Display Text Action.
####Shouldn't I be able to get the actual value via AppleScript?
####My Script:
####KM Display Text Action Shows correct value:
####KM Variable List in Preferences also shows "Password"
Used the “Set Variable to text” action on a bunch of variables named…
abc__namepart1a_part2a
abc__namepart1b_part2b
abc__namepart12_part22
Now, in the variables list in “Preferences” their content is shown as “Password”.
Also, I cannot delete them. Delete button in the Preferences doesn’t do anything. AppleScript also doesn’t do anything.
“Detect (and Conceal) Possible Passwords” is disabled. I also tried restarting Keyboard Maestro engine. Doesn’t change anything.
The problem goes away as soon as I remove the two underscores from the names of the variables (although the old variables that contain the two underscores still persist in my variables list and I cannot get rid of them).
(I used the two underscores because I am employing a user prompt, and everything before the double-underscore is not shown there.)
The actual prefix I used was “pwb__”. And, apparently, the problem wasn’t the two underscores, but the fact that the first two letters are “pw”. Keyboard Maestro seems to interpret this as meaning that the variable contains a password. Which explains why they are treated differently from other variables.
It still seems to be a bug, because according to @peternlewis password variables should not show up in the Preferences at all. I also wonder how I can delete them, now that they are there, because otherwise they remain as dead entries in my variables list.
Otherwise, the solution is simple:
I’ll just use a different prefix for these variables, and will refrain from using the letters “pw” at the start of any of my variables in the future.
Yes, they should not show up there. If you set their value to empty (the empty string) and delete any references to them in any macros, then they will no longer show up.
I will resolve them showing up there in the next version (there is no point them being there since you cannot see their value and you cannot change their value in the editor).