Getting It Done with a Shortcut in iOS 12
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.
Just added my Yahoo football pool as a shortcut using Siri.
I started playing with it. I'm downloading the podcasts for the Shootcuts series so I can listen to them repeatedly if needed, and follow along in the app. I can't wait to really see what I can do. And I can't wait to see what apps use this, and what their uses will be.
Thanks, will give it a twirl
Hi Paul and thanks for this post. I think I actually created a shortcut for Voice Memos a couple weeks ago without really meaning to do so. I don't think it works though, but I will definitely play around with these as time permits. Hopefully there's a shortcut out there somewhere for entering in my log-in credentials, other than Touch ID of course. I love Touch ID and am so glad Apple has it, but even though I now have that enabled for most things I've had to enter my log-in credentials a few times.
Jake, you might want to check out Settings > Passwords and Accounts. It might help you to enter your login details more quickly.
How does one know if a particular app supports the use of shortcuts?
Hi Peter. If you have both Shortcuts and the app in question on your iDevice, then open Shortcuts, select Create A New Shortcut, and in the action search field at the bottom, type the name of the app in question. If that app has any Shortcuts support, the available actions will show up in the search results.
And, if you don't find anything there, look in the shortcuts section of IOS>Settings>Siri. If you still don't find what you're looking for, then the third party app(s) doesn't/don't work with Shortcuts or with Siri Shortcuts.
When using the dictate action in a shortcut, when ran, Voice Over is recorded because she is talking at the beginning after the beeps. Does anyone know how to keep Voice Over from chatting after a dictation begins? I have tried turning off hints, but no matter what I try, Voice Over continues to be part of my dictation. Any help would be appreciated.
I guess you could try using earbuds so that the phone won't hear itself!
Hi Chris. Yes, this is annoying, but in my experience, if I just proceed and dictate while VoiceOver is chattering, the phone seems to filter my voice out from VoiceOver, and the dictation works fine. I have not found a way to turn off VoiceOver speech in a shortcut, sadly. If this continues to be an issue for you, then Pete's earbud suggestion is your best bet. (Good one, Pete!)
You could also try muting speech with the 3-finger double tap. Note, this is not the same as turning Voiceover off. Voiceover gestures remain in effect with speech muted.
Focus on the dictate button, mute speech then double tap to activate the dictate button. Speak your phrase then unmute speech with the 3-finger double tap again. (It's a toggle.) Let us know if this works for you.
Thanks Jeff. The specific issue we're encountering is when a shortcut contains a Dictate Text action. If the shortcut is executed with VoiceOver enabled, then VoiceOver reads "Shortcut, Text, Dictate text action" right when the user is supposed to be dictating the text. This seems like an issue with the Shortcuts app design. Either the Dictate Text action should have nothing for VoiceOver to read during execution, or there should be an action available to mute speech within the shortcut.
That being said, your suggestion of muting VoiceOver, for example just before executing the shortcut, is a great solution. Thanks.
Has anybody figured out how to pass a sound to the playsound action? It is an optional parameter, and I can only get the default sound to play but don't know how to pass other sounds to it. Sadly the documentation is not very forthcoming on some of the actions. I truly wish apple would make a reference library with good explanations.
From the description, I think it takes a sound file as input. So, if you had an MP3 or Apple-format audio file on iCloud, you could retrieve it with a Get File action, and follow that with a Play Sound action. I think that might work. Sorry I don't have time to try this for you at the moment. Let us know if it works.
Thanks for writing back. I was hoping to play sounds from with in the device itself, such as the text, or ring tones. Never used iCloud other than from the device. This parameter says it can also pull from dropbox, though I will have to figure out how the path works. Honestly it sounds kind of messy at the end. I am starting to wonder if the playsound command is buggy because it will play the default sound but it feels like there should be an option to add a sound or variable, like the text command has. Starting to wonder if there is a bug on that action.
Another solution is to add a weight action just before the dictate action. I found that a two second delay avoids this problem.
The root cause appears to be a timing issue with voiceover’s automatic announcement of its focus on the “Stop Shortcut” button and the shortcut’s request for dictation. I have not tested it, but my guess is that this won’t be an issue if a dictate action is deeper into a shortcut, so it may not always be a problem.
There is a video downloader shortcut in the gallary, has anyone figured out how to use that thing and with which websites it actually works?
I tried it with youtube,but it fails. There is one shortcut that is floating around for downloading youtube videos, though.
Just goes to show how many possibilities exist now with this shortcut app!
and nice blog post btw.
This is my first postT on Applevis. I want to be able to say to Siri “message somebody “ and have a message open with The recipient filled in and focus in the text field for the message body. I can then double tap to dictate my message text in pieces, Instead of having to blurt it out all at once.
I haven’t been able to get parameters from Siri, like the recipient name. Is that possible?
What input type does The send message action want for the recipients field? Do I need to get a contact and then extract something out of it?
since I couldn’t get a parameter from Siri, I tried to get the recipient with dictate text.
Here is my current code:
Text dictate text action
language English stop listening after pause
(I try to insert something here to get the contact information from the name. I hardcoded my name for testing.)
Show When Run switch off
Recipients, text field add contact button
Ask When Run text field
(I produced the above by taking a screenshot of the Shortcut screen, recognizing it with Seeing AI, and editing The result a lot. Is there a way to paste the source of a shortcut into text?)
When I run this with the run shortcut button, it listens for a name, shows the two QuickLooks, and presents a text field to enter a message. When I tap done, it sends me an email with a text file attachment.
I tried to use get contact to get the contact information, but it seemed to not output anything.
Any ideas? Is there a better place to post this question?