Add at Index

Add a new item to a list at a specific index.


Description

Yet another shortcut inspired by @atnbueno’s series of JavaScript one-liners!


How to use

Use a Run Shortcut action within other Shortcuts to run this one, and send a list as input (will not work with image or media lists currently). The list can be whatever you need or want, as long as the last two items are the index to insert at, and the item to insert (in that order).

The output will be your list with the new item inserted at the specified index.


Note

In order to stay consistent, I made sure that the JavaScript snippet works with the way that list items are indexed in Shortcuts. So the first list item is at index 1, second item at index 2, etc.


Latest Release Notes

1.1 - March 19, 2021, 11:32 p.m.

Simplified the Shortcut by doing the list-sorting in the JavaScript instead


Version history