JOIN a KM array with a delimiter.zip (9.3 KB)
Custom Keyboard Maestro Plug-in
(c) 2021 Robin Trew
- Join a KM Array with a delimiter
A given KM Array variable (in CSV or JSON) format, is joined together into a single string, using the supplied delimiter.
The KM Array variable can either be in a simple comma-delimited format:
or in JSON format (in which string values always need to be double-quoted, rather than single-quoted):
["apples", "oranges", "bananas"] [7, 49, 343]
For more on KM Arrays, see:
- CSV arrays: manual:Variables [Keyboard Maestro Wiki]
- JSON arrays: manual:JSON [Keyboard Maestro Wiki]
- This plugin has so far been tested on macOS Catalina, with Keyboard Maestro 9.2
INSTALLATION OF CUSTOM ACTION PLUGIN
- If updating a previous version of the action, first manually remove the
previous copy from the custom actions folder at:
~/Library/Application Support/Keyboard Maestro/Keyboard Maestro Actions
- Drag the .zip file onto the Keyboard Maestro icon in the OS X toolbar.
USE OF CUSTOM ACTION IN A KEYBOARD MAESTRO MACRO
- In macro-editing mode, click the green New Action button, select the
Third Party Plugins smart folder in the left hand panel of the Actions List
and choose the "Split a String to a List"
- Adjust the settings of the custom action, choosing the file path,
project name, and TaskPaper 3 item format that you want.
- Test the macro. If notifications are enabled on your macOS system, or you
have changed 'Display results briefly' to 'Display in a Window' at the
bottom of the custom plugin, you will see a brief summary of the result.
- Rob Trew - Twitter @ComplexPoint