Using Extra Buttons to Select Next Action on Prompt for User Input

This is an example macro using the result button variable.
I had a number of options in the prompt for user input,
so as well as the OK and Cancel, I wanted the ability to
set the options to specific defaults.
Just to show the principles, I have only one input field and
four buttons OK, Cancel, Pages setup and Option.
The first test is incorrect as it uses the Button on test.
The second is correct as it uses the Result Variable test.
This means it is very easy to give the user a choice and vary the macro
based on the button selected. Hope this helps.

1 Like

I can't see the picture in this thread... too old perhaps?
I would love some more input on how to use buttons other than OK/CANCEL, like for instance how to use the button HELP effectively.

Thanks for sharing your macro, except that the actual macro was not uploaded. See How To post/upload your script/macro.

So if IF statement only works with Variable trigger, why it has Button trigger?

See below macro.

Actions, like the If Then Else action do NOT have triggers. Only Macros have Triggers .

I'm not sure I understand your question, but maybe the below Macro will help.

Example Output



MACRO:   Demo Use of Buttons in Prompt for User Input [Example]

~~~ VER: 1.0    2019-05-18 ~~~


Demo Use of Buttons in Prompt for User Input [Example].kmmacros (55 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.



Hey presto!

So button linked to variable will work.

Thanks again Michael.

You've done it again.

Beautiful code.

1 Like

Great example, thanks!