Scripting is usually associated with computers, while using a smartphone has always been about interacting with apps. Smartphones don’t have as sophisticated a system shell as desktop systems. I won’t go into a discussion here about whether that’s good or bad. I just want to point to an interesting mechanism in iOS that allows for creating automations that connect different apps and parts of the system.
The “Shortcuts” App
This is where we create “shortcuts,” which are actually scripts, or sequences of steps that are executed when the shortcut is run.
In shortcuts, we can use basic logical operations, retrieve data from input or from the user, and call app actions.
We create shortcuts in a graphical interface, which of course differs from text-based code and takes some getting used to. There are a few differences and quirks that you simply need to learn.
Actions provided by iOS are quite diverse and sometimes surprisingly technical. In my opinion, the most interesting ones are:
- Converting almost anything to PDF format. A shortcut with such an action can even be attached to the share menu. This way, we can use shortcuts in various ways. For example:
- Select a photo from the gallery
- Use the share screen to run a shortcut
- Convert the photo to PDF
- Choose a folder to save it in
- Save the file with today’s date in the name
- Fetching the content of a URL. We can build the address ourselves, and this action will retrieve data from it. We can choose the method (GET, POST, etc.), and even add headers. This way, we can call any API from our phone.
- Executing a script via SSH. Similar to fetching content via HTTP, we have a lot of possibilities to do various things on the backend. And all of this can be triggered from a phone or tablet.
A vast number of functions lie in the library of actions and triggers provided by individual applications. Unfortunately, we don’t have control over what we can do with a given app and in this matter, we are dependent on what the developer of that app has prepared for us. Fortunately, more and more applications are providing at least basic tools.
If you want to learn more about this system, one way to start is reading the official documentation.
Example
I write this blog in Notion. I keep all my blog post ideas in a Notion Database. Whenever I had a new idea for a post, I needed to go to the Notion app, open the correct page, click the “+” button and write down the idea. That was quite a few clicks. And a few seconds, too.
Now I have a shortcut for that. All the input is handled by the shortcut engine, so data input is smooth — the iOS takes care of it. When the data is ready, the shortcut inputs the item into the database specified in the shortcut.
Here is my “New Blog Idea” shortcut:


You must be logged in to post a comment.