Keyboard Maestro includes tokens which allow us to work with:
- CSV formatted arrays,
- and JSON formatted arrays.
Obtaining individual items in the array by a 1-based index, and retrieving the length of the array from index 0
.
See:
- CSV arrays: manual:Variables [Keyboard Maestro Wiki]
- JSON arrays: manual:JSON [Keyboard Maestro Wiki]
Here is a simple example of using two custom plugins:
[SPLIT :: Custom plugin β Split a String to a KM Array]
(SPLIT :: Custom plugin β Split a String to a KM Array)
[JOIN :: Custom plugin β Join a KM Array with a delimite]
(JOIN :: Custom plugin β Join a KM Array with a delimiter)
Split can create CSV or JSON formatted KM arrays, using literal
or regex
delimiters,
and Join can create new strings by intercalating a supplied delimiter between the items of a KM Array.
Test for SPLIT and JOIN (2 Custom Plug-ins).kmmacros (22.2 KB)
-->