Introduction

When I explain iOS Shortcuts to people, I tell them that simple Shortcuts are straightforward, but the Shortcuts App is an interface for coding via drag-and-drop. Like any programming language, the Shortcuts App provides constructs for while loops, if statements, text parsing, etc.. Similar to code, Shortcuts can grow in complexity fast.

One of the coolest features of Shortcuts is that they can take input and return output. If you've run a Shortcut from the Share Sheet, you've passed input (the thing you were sharing) into a Shortcut. A lesser known feature of Shortcuts is that, using the "Run Shortcut" action, you can run one Shortcut from another. "Run Shortcut" accepts input which it passes to the Shortcut you are running, and it returns the output from the Shortcut that you run. You can do anything you want with the output. This should sound familiar to anybody with coding experience. In the context I am describing, Shortcuts are essentially... functions.

As you develop your own Shortcut library, making a folder full of functional Shortcuts is a good idea. It will save you time in the future by encapsulating functionality that you can re-use in your other Shortcuts–akin to functions in a codebase. If you've found yourself duplicating actions from Shortcut #1 into Shortcut #2, you probably could have broken those actions out into a functional Shortcut, Shortcut #3 that Shortcut #1 and #2 both utilize via the "Run Shortcut" action.

Sidebar: Calling one Shortcut from another is great for your own Shortcuts library. This practice breaks down if you want to publish your Shortcuts for others to use–you need to instruct people to install all required Shortcuts and their dependencies. There are utilities (such as ActionCuts), which embed one Shortcut into another on your behalf, but they are outside the scope of this blog post.

Paginator

The purpose of this post is to share a specific "Function Shortcut" I have created which I use in my other Shortcuts.

What's it do?

With the iOS 14 redesign, Apple changed the way lists are presented to users when using the "choose from list" Shortcut action. If you are presenting the user with lots of choices, the list is slow and choppy to scroll.

I fixed this by chunking the list into pages of 7 items each, and prompting the user with 7 items plus a next and a back button for navigating between pages.

Download it here.

  • Input: List of items
  • Output: A single item which the user selected from the list

Note: If this is your first shortcut, you might run into issues installing "Untrusted Shortcuts". I provide instructions for that here.

Usage Example

I created a sample Shortcut called Shortcut Picker which fetches all of your Shortcuts, has you choose one with the Paginator, and runs the selected shortcut (with no input). It is a quick illustration of how to leverage the Paginator Shortcut from another one of your Shortcuts.

Download it here.