I am trying to create a macro that will present two buttons, “Yes” or “No”. After the buttons are pressed I would like it to return
I have set up a prompt for user input, to get the display dialog with the buttons.
However, I created an if/then condition to return the text if a button with the name matching "Yes’ is enabled to insert text “Yes” by typing, otherwise insert text “No” by typing.
No matter which button I press I get “No”.
Any ideas why or can you show be how this macro should be set up?
It looks like you accidentally left out what it is you would like the pressed buttons to return:
So I'm not 100% sure that this is what you're looking for, but based on the rest of your post, it sounds like you're trying to accomplish something like this?
From your description, it sounds like your macro wasn't working because an If/Then action like that which comes after the prompt action would be looking for a "Yes" button that no longer exists. KM is designed to only proceed to the next action in a macro once the previous one is finished (a few asynchronous options aside) so once a button in the prompt is chosen, that button would no longer exist when the If/Then condition is looking for it. Thus, in this case, the If/Then it will always return a negative "Otherwise" result, which in turn would lead to "No" always being typed.
As you can see in my example macro, the way to determine what a macro will do next based on the button chosen in a prompt is to use the %PromptButton% token. You can read a bit more information on how this part of Prompt For User Input works here: action:Prompt for User Input [Keyboard Maestro Wiki]
Feel free to ask if anything is unclear, or you have any further questions!