Subrange or "slice" within Variable (and JSON) Arrays?

all provide us with an invaluable (one-based) index notation (and the array length at index 0).

Is there any way, in terms of Keyboard Maestro tokens (and / or functions) of specifying a sub-range or "slice" within an array ?

( for example the first three – or last three – items in an array, or all items from position 2, etc etc )

( I am thinking of something analogous to the Python slice indices, or the JS Array.slice function )


We can do this, of course, by slipping into an Execute Shell or Script action, but I wondered if there was also a more KM native approach that I haven't yet spotted ?

1 Like