Home automation is the perfect example of such background tasks. Contrary to what I expected, Shortcuts doesn’t offer a full-blown HomeKit integration to control individual characteristics of accessories or create recurring automations. For that, you’ll still have to use the standalone Home app. Instead, Shortcuts can set HomeKit scenes for any of your configured homes.
To trigger HomeKit scenes in Shortcuts, you’ll need to use the new ‘Run Home Scene’ action. Once added to a shortcut, there are two parameters to configure for this action: the home you want to control, and an existing scene you want to set. HomeKit scenes are presented in a list that can’t be searched, which may be slightly inconvenient for heavy HomeKit users who have set up dozens of scenes in their homes. Fortunately, the ‘Scene’ field of the action supports Magic Variables, so you can pass the name of a scene previously picked from, say, a custom ‘Choose from List’ action.
Despite the barebones nature of this action (as I mentioned above, you can’t control individual HomeKit accessories at all), I appreciate the inclusion of ‘Run Home Scene’ in Shortcuts as it allows the app to interact with HomeKit, even if in a limited fashion. This means it’s finally possible to build widgets that trigger HomeKit scenes or have Siri execute multiple scenes in a row. As I’ll explain later on, I’ve been taking advantage of this integration for a shortcut that I couldn’t create with the old Workflow app.
Set Do Not Disturb
With this new action, you can enable Do Not Disturb with the same set of options available in Control Center.
Once added to a shortcut, flipping the Do Not Disturb toggle will reveal an ‘Until’ field in the action that lets you choose between multiple options for disabling Do Not Disturb later:
- Until turned off
- Until a specific time
- Until you leave the current location
- Until a calendar event ends
Of these settings, the ‘Time’ and ‘Event Ends’ options can be configured with variables. For time, you can pass a valid date/time item (which can be typed in natural language too) and Shortcuts will engage Do Not Disturb and automatically disable it when it reaches its expiration time. For the calendar, you’ll need to pass a Calendar Event object, which you can obtain with the ‘Find Calendar Events’, ‘Add New Event’, and ‘Get Upcoming Events’ actions.
Alas, Shortcuts cannot schedule Do Not Disturb to start at a specific time; it can only enable it now and disable it later. I assume this is due to iOS’ own inability to create standalone Do Not Disturb schedules. In the future, I’d like this action to include a start time option and new ways to control the geofence’s radius when leaving a location. Still, it can be useful to activate Do Not Disturb as part of a more complex shortcut, or to have a widget that can set Do Not Disturb with presets.
If you want to annotate an image or PDF document and save it somewhere else, Shortcuts now supports the native iOS Markup mode – the same annotation feature you can use in Notes, Files, and other system apps.
The Markup action supports images and PDFs as input types, and returns their annotated versions as output. Whether you’re using it in the Shortcuts app or in the share sheet, the action will display the full-screen annotation UI to add shapes, text comments, and drawings to a document. It would have been nice to set default colors and tool sizes to be automatically loaded when Markup comes up, but I’m just nitpicking at this point. I’ve had fun incorporating this action in my screenshot shortcuts.
Other System Actions and App Changes
Here’s a list of other system actions that are new in Shortcuts:
Open multiple URLs at once. Shortcuts replaces Workflow’s old hack to open multiple URLs in Safari with a native solution to open dozens of links at once in separate tabs. In a nice touch, Safari can present a new prompt if you attempt to open too many URLs at once; on most devices, the prompt will be displayed if you try to open more than 50 URLs, but the threshold is lower on older devices. In addition to being tied to Shortcuts’ Open URLs action, the new prompt also kicks in if you try to drag and drop too many links onto Safari’s + button on iPad.31
Send and Request Payment. Based on the existing SiriKit domain for payments, these actions allow you to request and send money using third-party payment apps that already work with Siri. For instance, in addition to Apple Wallet, you can use Square Cash or N26 as actions that don’t even need to open the main app (though that’s an option). Fields you can customize with variables in these actions include the recipient’s email address, amount, and optional notes.
iCloud sharing. In replacing the old Workflow Sync service, Apple also reworked how sharing shortcuts with other people works in the new Shortcuts app. You can now share custom shortcuts via iCloud: in the shortcut editor, tap the share sheet and choose ‘Copy iCloud Link’; after a few seconds, the share sheet will be dismissed and you’ll have an
icloud.com shareable URL in your clipboard.
Opening the iCloud link for a shared shortcut takes you to a webpage containing a preview of the shortcut and a button to import it into the Shortcuts app. In my tests, iCloud sharing – just like the new iCloud shortcut sync – has been fast and reliable.
Device Scripting. In the Device section of the Scripting category, you’ll find new actions to toggle Airplane Mode, Bluetooth, Cellular Data, and Low Power Mode. Unfortunately, it is not possible to connect to specific Bluetooth devices from Shortcuts.
Set Brightness. In the old Workflow app, this action could only control the brightness of the app itself. In Shortcuts, you can change device brightness system-wide without opening Control Center. As before, you can set brightness manually with a slider or by passing a numeric variable between 0 and 1.
Show Result and Siri Integration
The last new action in Shortcuts deserves a standalone mention as it’s probably the most important of the bunch, and the one that will unlock fascinating new possibilities for automation in iOS 12. The action is called ‘Show Result’, and it allows you to program a custom Siri response that the assistant will display and read aloud when a custom shortcut is triggered with a personalized phrase.
This brings me to another essential advantage of Shortcuts over Workflow: in iOS 12, you can assign a phrase to a custom shortcut and let Siri execute it in the background like other native app shortcuts. With the exception of specific cases in which Siri won’t be able to complete execution of a shortcut inline, this integration allows you to enhance Siri with a virtually endless list of personal commands. With iOS 12 and Shortcuts, automation turns into something more than running a sequence of actions in an app or widget: it can become a way to expand Siri itself, making it infinitely more useful and tailored to each user.
To trigger an individual shortcut with a custom phrase, you need to open a shortcut’s settings screen and tap the ‘Add to Siri’ button. Once given a phrase, a shortcut can be summoned from Siri, which will run it in the background unless it hits a step that isn’t supported by the assistant.
In this first version of Shortcuts, unsupported actions include any kind of user interaction. If a shortcut requires you to type or dictate text, choose from a list of items, or preview data with Quick Look, Siri will have to open the Shortcuts app and finish executing the shortcut there. Only shortcuts that do not require any user interaction can be fully executed inside Siri.
With this in mind, if you have shortcuts that perform sequences of actions without your input or launching other apps, you’ll be able to run them entirely within Siri. When you summon a shortcut with a custom phrase, Siri will display a “Running your shortcut…” message along with a small intent snippet for the requested shortcut; it’ll then proceed to run actions in the background and, if available, provide you with a custom voice response.
Custom Siri responses can be configured with the ‘Show Result’ action. This is similar to ‘Show Alert’ in that it can be filled with arbitrary text or variables and doesn’t support showing images or other document types with Quick Look – just text.
Unlike Show Alert, the Show Result action doesn’t have a title field and doesn’t contain buttons to continue or stop execution of the shortcut. If a shortcut is running inside the Shortcuts app, the extension, or the widget, Show Result will bring up a native alert; however, when a shortcut is invoked from Siri, Show Result’s alerts become text responses read aloud by the assistant.
Responses configured in the Show Result action can be as verbose as you want, and they can be intermixed with other actions or suggested shortcuts by apps. For example, if a custom shortcut contains both native app shortcuts and a custom Show Result response, running the shortcut in Siri will produce multiple responses: you’ll see the visual intent and response from a third-party app, plus the response you configured yourself in the Shortcuts app.
In the example below, you can see how a custom Show Result response (labeled as “Shortcuts says…”) coexists with other native app shortcuts, each executing a task in the background. The same custom shortcut can even have multiple Show Result responses, which Siri will read as it runs through each action.
With shortcuts and customizable responses, Apple is effectively giving users an intuitive tool to program their own Siri commands. All of this happens with no traditional “coding” whatsoever. This approach is not necessarily about automation per se as much as it’s about automation as a means to an end – leveraging Shortcuts’ automation features to make Siri do exactly what we need.
As you’re going to see with the following examples, the marriage of Siri and Shortcuts automation unlocks a whole new level of flexibility in iOS 12.