action:Prompt_for_User_Input
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| action:Prompt_for_User_Input [2021/10/14 06:57] – peternlewis | action:Prompt_for_User_Input [2023/09/13 04:04] (current) – [Slider Field] peternlewis | ||
|---|---|---|---|
| Line 59: | Line 59: | ||
| The field will be displayed as a single line text input field. | The field will be displayed as a single line text input field. | ||
| + | |||
| + | The default field is a token text field. | ||
| ==== Password Field ==== | ==== Password Field ==== | ||
| The field will be displayed as a single line password input field, displayed with bullets instead of characters. | The field will be displayed as a single line password input field, displayed with bullets instead of characters. | ||
| + | |||
| + | The default field is a token text field. | ||
| ==== Checkbox ==== | ==== Checkbox ==== | ||
| The field will be displayed as a checkbox. If the default value is “0”, or starts with “0|”, then the checkbox will default to off. If the default value is “1”, or starts with “1|”, the checkbox will default to on. | The field will be displayed as a checkbox. If the default value is “0”, or starts with “0|”, then the checkbox will default to off. If the default value is “1”, or starts with “1|”, the checkbox will default to on. | ||
| + | |||
| + | The default field is a token text field. | ||
| ==== Menu Field ==== | ==== Menu Field ==== | ||
| Line 96: | Line 102: | ||
| The result stored in the variable will be the value of the slider. | The result stored in the variable will be the value of the slider. | ||
| + | |||
| + | This default value field is a calculation field. | ||
| + | |||
| + | Up to Keyboard Maestro version 10.2, the result of the slider will always be an integer, and any initial value above 100 will be clipped to 100 ([[https:// | ||
| ==== Color Field ==== | ==== Color Field ==== | ||
| Line 102: | Line 112: | ||
| The default | The default | ||
| + | |||
| + | This default value field is a calculation field. | ||
| ==== Date and Time Fields ==== | ==== Date and Time Fields ==== | ||
| Line 109: | Line 121: | ||
| The default value is [[/ | The default value is [[/ | ||
| + | This default value field is a calculation field. | ||
| + | ==== Labels ==== | ||
| + | It can be a good idea to have a common prefix in all of the variables used by the same macro. | ||
| + | So, you can hide the prefix if the variable name starts with a prefix followed by two underscores. Then the label will show only the latter part of the variable name. | ||
| + | Similarly, you can use Instance or Local variables, and the “Instance” or “Local” will be removed from the variable name when displayed in the form. | ||
| - | + | For example, | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | === How to Use a Variable for the Popup Choices === | + | |
| - | + | ||
| - | * Sometimes you might like to use a Keyboard Maestro Variable to store the list of Popup Choices, and then use this Variable in the Prompt for User Input Action. | + | |
| - | * If the Popup default value starts with a bar (|), then the Variable (which contains choices separated by `|`) will be expanded and evaluated before the Prompt is displayed, thus showing the choices from the Variable. | + | |
| - | + | ||
| - | Otherwise, the entry is separated by bar first, and then token expansion is applied to each field, so that fields may contain bars, for example, “This|That|%Variable%One Entry%”. | + | |
| - | + | ||
| - | === How to Hide a Variable Prefix in the Prompt === | + | |
| - | + | ||
| - | It is a good idea to have a common prefix in all of the variables used by the same macro. | + | |
| - | + | ||
| - | **So, you can hide the prefix if the variable name starts with a prefix followed by two underscores**. Then the label will show only the latter part of the variable name. | + | |
| - | + | ||
| - | For example, if you enter " | + | |
| - | * It will display | + | |
| - | * But the actual variable | + | |
| - | + | ||
| - | ==== Checkbox Field ==== | + | |
| - | + | ||
| - | If the popup menu would contain only " | + | |
| ==== Buttons ==== | ==== Buttons ==== | ||
| Line 144: | Line 138: | ||
| - {{: | - {{: | ||
| * Responds to shortcut < | * Responds to shortcut < | ||
| - | * Closes the Prompt | + | * Closes the Prompt. |
| - | * Flows proceeds to next Action | + | * Flows proceeds to next Action. |
| - {{: | - {{: | ||
| * Responds to shortcuts of either < | * Responds to shortcuts of either < | ||
| - | * Closes the Prompt | + | * Closes the Prompt |
| * **Cancels the Macro** | * **Cancels the Macro** | ||
| - | === Optional Buttons Can be Assigned Shortcut Keys === | + | You can add more buttons to allow for other options. For example, “Save” and “Save and Send”. |
| - | You can optionally assign a shortcut key by applying a suffix to the Button Name in the form of / | + | You can optionally assign a shortcut key by applying a suffix to the Button Name in the form of / |
| ^Suffix^Button Responds to Shortcut Key of:^ | ^Suffix^Button Responds to Shortcut Key of:^ | ||
| |`/ | |`/ | ||
| |`/ | |`/ | ||
| - | |`/ | + | |`/ |
| + | |`/-`|no shortcut| | ||
| === Result Button === | === Result Button === | ||
| Line 166: | Line 161: | ||
| === How Buttons are Processed === | === How Buttons are Processed === | ||
| - | * The first button (from the top) has a default key of < | + | * The first button (from the top) has a default key of < |
| * The second button has a default key of either < | * The second button has a default key of either < | ||
| * Any button can _Cancel_ the macro if the " | * Any button can _Cancel_ the macro if the " | ||
| Line 173: | Line 168: | ||
| * If you have the system preference “Use keyboard navigation to move focus between controls” enabled, the button shown with a colored outline (usually blue) can be chosen/ | * If you have the system preference “Use keyboard navigation to move focus between controls” enabled, the button shown with a colored outline (usually blue) can be chosen/ | ||
| - | **Guidelines for Good Button | + | === Guidelines for Good Button |
| - | * The default button should be the "OK" | + | * The default button should be the “OK” button, the one that performs the *normal behaviour*. |
| * The default button should be rightmost. | * The default button should be rightmost. | ||
| * The left most button should be " | * The left most button should be " | ||
| Line 181: | Line 176: | ||
| * If the normal behaviour is significantly dangerous, then it may be appropriate for it to not be the default button, or for there to be no default button. | * If the normal behaviour is significantly dangerous, then it may be appropriate for it to not be the default button, or for there to be no default button. | ||
| - | " | + | “Normal |
| A consequence of all of this is that if you have a second button in the Prompt For User Input action, and it does not cancel the macro, then you should definitely give it some other key, or disable it with “/-”. | A consequence of all of this is that if you have a second button in the Prompt For User Input action, and it does not cancel the macro, then you should definitely give it some other key, or disable it with “/-”. | ||
| - | |||
| - | An update is planned so that if the first button has the Cancel Macro flag, then it is not the default (by default), and if the second button does not have the Cancel Macro flag, then it does not get the Escape/ | ||
| ===== Notes ===== | ===== Notes ===== | ||
| Note that the system will not allow Keyboard Maestro Engine to see keys typed in its own windows so the [[trigger: | Note that the system will not allow Keyboard Maestro Engine to see keys typed in its own windows so the [[trigger: | ||
| - | |||
| - | Note that the system really really wants a " | ||
| ===== See Also ===== | ===== See Also ===== | ||
action/Prompt_for_User_Input.1634194649.txt.gz · Last modified: by peternlewis
