I find this very handy when writing/debugging macros. I trigger each option via dedicated Stream Deck buttons, but not everyone has a Stream Deck, so I've set it up here to work via a prompt.
Button: inserts a Press Button when Enabled action with the button name determined by a user prompt.
Text: inserts a Display Text action with the displayed text determined by a user prompt with display type options.
TriggerValue: inserts a Display Text action preset to display %TriggerValue%.
SystemClipboard: inserts a Display Text action preset to display %SystemClipboard%.
YES: inserts a Display Text action preset to display YES (useful when determining if a macro is successfully reaching a certain point of its run).
Variable: inserts a Display Text action set to display a variable. Before triggering this, ensure the text field containing the desired variable is currently selected.
Variable Prompt: as above, but in the form of a user prompt, which acts as a pause, giving you the option to either continue from that point or cancel the macro.
I would be very interested to know: Which method do you use for the call via Streamdeck? And do you have a special profile for KM or do you use it via a special folder?
I'm new to using Streamdeck and would love to know more if you have anything to share
I use KMLink and make good use of the Parameter function (accessed in KM via the %TriggerValue% token), so that multiple buttons calling the same macro can do different things. I organise macros in Groups according to their app-specific availability rather than how they're called.
Oh wow, thank you very much, I will try KMLink. I tried the Elgato Keyboard Maestro plugin, but gave up after I realised that the macro is bound to the button and can only be moved in an elaborate way... Thanks!
I like this Neil! I have something similar for predefined actions, like a comment with a date stamp and the words “Follow up comment” for macros I need to come back to later on (and a corresponding smart group for macros with said comments).
Any reason you went with the prompt for user input instead of prompt with list? I’ve found the prompt with list is faster when I don’t need to select multiple options.
This is neat. How do you figure out the XML code for the different actions?
I wanted to expand on your macros, but can't get my new choices to work. I tried to manually create the actions, then export it and copy-n-paste the XML back in, but it doesn't work.
I typed recognisable words into the various fields of an action I want I reproduce programmatically, then copied as XML and pasted into TextEdit.
I used these words as a visual reference for which value should go in which part of the code and I replaced them with variables.
Then, in order to paste this into a Set Variable action, you have to 'break' the XML by adding a random word somewhere it shouldn't be.
Copy and paste the XML, then delete the random word. This enables it to be pasted as text. If you don't do that, the XML will actually be pasted as actions.
Do yourself a favor and use a good plain-text editor like BBEdit when working with plain-text.
Eventually with TextEdit you'll accidentally monkey with RTF when you think you're working with plain text and fall down a rabbit hole – not to mention the fact that TE is feature-poor.
This makes sense for StreamDeck since you want to press one button for each action you want to insert, but for keyboard "choose action", I would think KM's native Favorite Actions, or KMFAM might be a better choice? You just set up the action(s) the way you want them, and save them as a favorite action.
If you want to prompt for user input, you can use KMFAMs "Favorite Macro" feature, although I'll admit the documentation is probably lacking in this area.
Correct me if I'm wrong but I think they do slightly different things. For example, if you select "Variable", the specific variable in the currently selected action field will appear in the newly created display action below it. Very useful!