If I use %PromptButton% to get the name of the last selected "Prompt for User Input" button, this value is always empty, whereas the %ResultButton% does always contain the correct values.
Also in the menu "KeyboardMaestro >> Preferences >> Variables" %PromptButton% does not have any value. If I enter any value to %PromptButton% it keeps this value regardless of the name of any selected "Prompt for User Input" button.
Does anybody know what I can do to further investigate this error. I am using KeyboardMaestro version 10.0.1.
Good idea thanks, I wasn't aware of the KM Log files. But they seem to be ok:
Last message repeated 8 times
2021-12-01 13:12:05 Execute macro “Test” from trigger Editor
2021-12-01 13:12:05 Log: Message
I could not see anything that is wrong in the script (aside that there is no trigger)
But let guess what is wrong first (I could be wrong)
Did you try running the whole script that is triggered by shortcut key , or did you just try only running each action by "Try Action". If you just running "Try Action" , I get the same result as yours. So have you try to set a shortcut key trigger and run them as a whole instead.
I just run the same test from a shortcut key trigger and got exactly the same result. Interesting that you got different results. I was not aware that running a macro e.g. for testing from "Try Action" can give different results than running from a key shortcut trigger.
But anyhow this gives unfortunately not a solution.
You cannot use %Variable%, you can only use %PrompButton% as it is token.
There is a difference between token and variable, only variable can be referenced by %Variable% , token cannot. Take away that %Variable% in %PromptButton%, you will see that it works.
By the way, the misleading point was the "Insert Token"-menu in the Action "Display Text". If I open my "Insert Token" menu, I have there an entry "PromptButton". If use it, it inserts "%Variable%PromptButton%. I am not sure, if that is only in my menu or if that may be a bug.
The fact that you've used %Variable%PromptButton% previously means there is now a global variable called PromptButton just waiting there to further confuse you. Go into the Variables pane in KM prefs and delete that variable and then the only PromptButton you'll see is the real KM token.