Using extra buttons to select next action on Prompt for user input


#1

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.


#2

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.


#3

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


#4

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


#5

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

image

image


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

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

DOWNLOAD:

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.


image


#6

Hey presto!

So button linked to variable will work.

Thanks again Michael.

You've done it again.

Beautiful code.


#7

Great example, thanks!