I bet my spouse is starting to wonder why I'm sending her so many text messages. I'm testing my new shortcut, of course. No, I didn't create a shortcut to annoy my spouse. She likes to track our spending, and my new shortcut tells her what I've been purchasing.
This blog gets you started with a drop-dead simple shortcut, and then describes the shortcuts I created to help track my spending. But first—
What is a Shortcut?
The Shortcuts app, formerly called Workflows, lets you specify one or more actions, called shortcuts, that you launch with SIRI or by selecting a desktop icon. If you've used Automator on MacOS, Shortcuts will be familiar to you.
For information on the Shortcuts app, take a look at Thomas Domville's podcast series, How to Use SIRI Shortcuts in iOS
Also, see Apple's Shortcuts User Guide.
Shortcuts and SIRI Shortcuts are two different things. A shortcut is a set of actions created with the Shortcuts app. A SIRI Shortcut performs some task using SIRI. This blog discusses how to create shortcuts with the Shortcut app, and then how to launch it with a SIRI Shortcut. Confused? Sorry. I didn't decide on the naming scheme.
What Can You Do with Shortcuts?
A shortcut to facilitate video recording an encounter with the police has been getting media attention lately. It's a great example of how shortcuts can control iOS features. Among other things, this shortcut stops any music that might be playing, turns down the screen brightness, turns on video recording, turns on Do Not Disturb, and sends a text to a contact, all launched by a SIRI Shortcut.
But you don't need to download that shortcut to get a sense of the possibilities. The Shortcuts app comes with a gallery containing dozens of ready-made shortcuts. Open the Shortcuts app and select the Gallery tab to browse through them.
Better yet, take a look at the Shortcut app's list of actions. In the Shortcuts app, select the Create Shortcut button, then browse through the actions at the bottom of the screen. You can also use the actions search field. Want to know what you can do with Maps? Enter map into the search field and examine the search results.
Go Ahead and Make Mistakes
Creating a shortcut is a little like riding a bicycle. You have to fall off a few times before you master it. In the course of writing this blog, I created several dud shortcuts that didn't work as I expected. I simply deleted them and tried again. Don't be afraid to make mistakes while learning to use Shortcuts. Rather, dive in and make as many mistakes as you want. You won't break anything, and it's the best way to learn.
My First Shortcut
To familiarize myself with the app, I decided to create a simple shortcut to turn on both Airplane Mode and Do Not Disturb, and activate it by telling SIRI, "Run silent".
Open the Shortcuts app. Select the Create Shortcut button in the upper right corner. Take a moment to familiarize yourself with the app layout and controls.
Naming the Shortcut and Setting Up SIRI
While you're getting familiar with the app's controls, why not give your new shortcut a name and record the SIRI Shortcut to launch it? Select the Shortcut Settings button in the upper-right corner. Then find and select the Name button. The name is set to Unnamed Shortcut by default. Clear that name and add your own, then select the Done button.
While still in Shortcut Settings, find and select the Add To SIRI button to record your SIRI Shortcut phrase. Find and select the Record button at the bottom center of the screen, then speak your phrase. I spoke the words "Run silent". Don't double-tap to stop recording. SIRI stops recording automatically when you stop speaking. Then select Done in the upper right corner to return to the shortcut edit screen.
Creating the Shortcut
Now that you've given the shortcut a name and set up a way to launch it with a SIRI Shortcut, it's time to actually create the shortcut. This very simple shortcut will contain two actions.
- Set Airplane Mode - Turn Airplane Mode on or off.
- Set Do Not Disturb - Turn Do Not Disturb on or off. This action is set to off by default.
To add an action, look for the Search field near the bottom of the shortcut edit screen. Enter airplane in the Search field. Find and select Set Airplane Mode from the search results. Congrats! You just added your first action.
Drag your finger near the top of the screen to find the Set Airplane Mode Action. Swipe right from there to find the action's switch button parameter. It should be set on by default.
Now let's add the second action. Find the Search field again, and this time enter disturb. Find and select Set Do Not Disturb from the search results. You just added your second action! Cool!
But this time it defaults to off. To change it, drag around the screen until you find Set Do Not Disturb Action, then swipe right to find the switch button parameter. Select to toggle it. Note that the Set Do Not Disturb action has a second parameter to automatically disable Do Not Disturb after some elapsed time. I left this disabled.
Now you have a shortcut with two actions. The first enables Airplane Mode, the second enables Do Not Disturb.
Ready to test it? Drag around near the top center of the screen to find the Run Shortcut button, then select it. Or, you can use SIRI and speak your SIRI Shortcut phrase. After the shortcut runs, open the control center, and you can quickly determine that both Airplane Mode and Do Not Disturb are enabled. Turn them both off, then return to the Shortcuts app.
Congratulations! You just created your first shortcut. It contains two actions, and you changed the Set Do Not Disturb Action's parameter to control how it operates.
So How Do I Turn it Off?
After using the Run Silent shortcut a few times, you've probably been frustrated that there's no easy way to turn it off. SIRI would be unable to launch a second Shortcut because SIRI doesn't operate while Airplane Mode is on. Thomas Domville solved this problem elegantly in Part 3 of his SIRI Shortcuts podcast series. He disables his similar Quiet Mode shortcut with a widget accessed from the Today or Spotlight screen.
Tracking My Spending
My spouse keeps close tabs on our spending. Every time I buy something, I dictate it into a note. At the end of the week, I text the note to her and clear my purchases out of my note for next week's expenses. I wanted to automate this with Shortcuts, but the Notes app lacked Shortcuts support. Argh! Frustrating!
An email conversation with AppleVis editor David Goodwin pointed me towards a solution. Thanks, David! The trick was to substitute an iCloud file for the Notes app, because Shortcuts has rich support for iCloud files.
The New Spending Shortcut
Let's create a shortcut that takes dictated text and appends it to an iCloud file.
In the Shortcuts app, create a new shortcut. Open Shortcut Settings to name it and record a SIRI Shortcut to launch it. I named mine New Spending and also used that name as the SIRI Shortcut phrase.
When I run this shortcut, I want to dictate some text (like "$3.00 for coffee") and have that text added to my iCloud file. That means the shortcut needs two actions.
- Dictate Text - Translate dictation to text and pass the text to the next action.
- Append To File - Append text from the previous action to my iCloud file.
The Dictate Text action has parameters to control language and when to stop listening. I used the defaults.
When you add the Append To File action, take a close look at its parameters.
- Specify the file sharing service, which defaults to iCloud, but it also works with Dropbox. I used the default.
- Specify the file name. I edited this and named the file spending.txt. Remember this. We'll need it for the next shortcut.
- Specify whether to append or prepend to the existing file text. The default is Append.
- Specify whether to automatically make a new line. This defaults to on, so that each added text segment is on its own line.
The Append To File action has a nice feature. If the specified file doesn't exist, it creates it automatically.
A Tip for Testing
After creating the shortcut, go ahead and run it. But, after it runs, how do you know it worked? You could open the file using the Files app, but an easier solution is to add a third action to automatically open the file. That's what the Quick Look action does. Go ahead and add this action during development to display the file with the text you dictated. After your shortcut is working properly, you can remove it.
Other Cool Stuff You Can Do
At this point, the shortcut works, but it's not at all fancy. Maybe you'd like your shortcut to prompt you before dictating? Add these two actions.
- Text - This action has a text field parameter. Enter the text prompt you'd like to hear, such as "What did you buy?".
- Speak Text - This action speaks text from the previous action.
Note that these new actions will be added to the bottom of your shortcut. You'll need to reorder them so that they occur first. To reorder an action, find the action you want to move, then tap and hold. VoiceOver will announce that the action is moving. Then drag it into place.
The Send Spending Shortcut
The next shortcut sends the contents of my spending file as a text message to my spouse, then deletes the file.
Create another new shortcut. In Shortcut Settings, name it and record a SIRI Shortcut. I used Send Spending for both the shortcut name and the SIRI Shortcut.
It takes four actions to send and delete the spending file.
- Get File - Retrieve the file from iCloud and pass it to the next action.
- Send Message - Send the file from the previous action as a text message.
- Get File - Yes, get the same iCloud file a second time, and again pass it to the next action.
- Delete File - Delete the file from the previous action.
The Get File action is a lot like the Append To File action from our previous shortcut. One difference is that Get File has a Show Document Picker parameter to select a file when the shortcut runs. Because I always want to send the same file, I turned this off and specified the file name from the previous New Spending shortcut. Remember it? I called it spending.txt, and I use the same name here in both Get File actions.
You might think it's a bug that there are two Get File actions, both for the same file. This isn't a bug, it's the way the Shortcuts app is designed. Actions pass values to the next sequential action. The first Get File passes our spending.txt file to the Send Message action. Send Message doesn't pass a value, so we need a second Get File to pass spending.txt to the Delete File action.
Let's look at the parameters for the Send Message action.
- Show When Run - Optionally display the text message before sending. I left this off.
- Recipient - Specify who will receive the text. I selected my spouse's mobile number using the Add Contact button.
- Message - Specify text to send. I left this blank to use the text from the previous Get File action.
Testing and Debugging
If you're creating a similar shortcut that sends a text message to your spouse, keep in mind your spouse will get a text every time you test the shortcut. My spouse valiantly endured the testing phase. After I tried this shortcut about six times with various minor changes, I was satisfied that it worked as desired.
So, What's the Big Deal?
How did this shortcut improve my life?
Previously, I could dictate my spending into a Note by telling SIRI "Add to my spending note" and then dictating my purchase. The New Spending shortcut provides about the same functionality, so no big deal, right?
But sending my note to my spouse used to consist of several manual steps, including opening my spending note in the Notes app, selecting the Share button, selecting Messages, entering my spouse as a recipient, selecting Send, and clearing my spending items out of the note. Now, this all happens in a single shortcut. I just say "Send spending," and it's done.
That is a big win. Thank you, Shortcuts!
What You Can't Do
Have you ever tried searching for and downloading an audiobook in the BARD Mobile app? How about reporting a robocall to the NoMoRoBo call-blocking app? Both of these tasks consist of many steps that I was hoping could be automated with Shortcuts.
Unfortunately, Shortcuts is not a general-purpose tool for moving to and activating controls. There is no equivalent of the Watch Me Do functionality in MacOS Automator. In order for Shortcuts to perform a task in an app, the app designers must explicitly add support for Shortcuts. Until BARD Mobile and NoMoRoBo add Shortcuts support, I'm stuck using them manually.
Shortcuts is a powerful tool for interacting with iOS and app features. A shortcut can automate sequences of tasks you perform on a regular basis. While it doesn't work with apps that lack Shortcuts support, it's capable of performing a mind-boggling number of tasks.
The best way to learn Shortcuts is to start simple. Don't be afraid to make mistakes with Shortcuts. When you create a shortcut that doesn't work as expected, delete it and start over. I do this all the time. The more you play with Shortcuts, the more obvious it becomes.
Have fun with Shortcuts, and please post your questions, successes, and failures in the comments below.