PURPOSE
This macro demonstrates a Prompt For User Input Dialog Box with the following characteristics:
-
Includes additional descriptive information the first time the macro runs.
-
Dialog box settings are saved to a KM dictionary rather than separate global variables.
-
Contains three elements: Text Entry (New Color), Popup List (Color Selection), and Checkbox (Delete Selection).
- The Text Entry value can be used to add an item to the Popup List item. Added items are sorted.
- The Checkbox value can be used to delete an item from the Popup List item.
- The default Popup List item changes based on the previous macro action.
DIALOG BOX SETTINGS
As mentioned above, the dialog settings are saved to a dictionary. The name is jsDDPL_dict, where js are my initials and DDPL represent the macro name. The structure is as follows:
{
"ColorSelection": "Blue",
"DeleteSelection": "0",
"OtherColors": "Blue\nGreen\nRed",
"RunStatus": "1"
}
TESTED WITH
- Keyboard Maestro, v10.0.2
- Monterey, v12.2/MacBookPro16,1
- Mojave 10.14.16/Macmini6,2
- High Sierra 10.13.6/iMac11,1445
VERSION HISTORY
1.0 initial version
1.1 No change to macro functionality. Defined local_DICT and used it rather than hard-codng dictionary name throughout.
DOWNLOAD Macro File:
Dialog with Dynamic Popup List.kmmacros (50 KB)
Note: This macro was uploaded in a DISABLED state. It must be ENABLED before it can be run. If it does not trigger, the macro group might also need to be ENABLED.