Hackernoon logoHow to Setup Shortcuts on iPhone iOS by@MaryHacks

How to Setup Shortcuts on iPhone iOS

Author profile picture

@MaryHacksMary Hacks

The OSX 13 users have now a new opportunity to use Shortcuts. It is an interesting tool that helps automate frequently used features. Further, it may expand Siri’s features on iPhone. At the same time many iOS users don't actually know how to use this tool. If you belong to this group of people, you’ve come to the right place.
Why Do You Need Shortcuts on iPhone?
Basically, Shortcuts can unite several simple user actions into one. Imagine that every morning you search the weather forecast for the day, play your favorite track on iPhone and send a message to your partner. With Shortcuts, all this routine can be performed with one click or with a quick voice command. The app can work with the Safari browser and other iOS programs via the API, so it’s easy, for example, to upload different playlists to “Music” according to your mood, turn on/off the alarm clock, apply a filter to a set of photos or attach your current GPS location when you respond to the friends’ message like, "Where the hell are you???” Shortcuts can easily cope with all these tasks.
At the first blush, it’s deadly easy to set up shortcuts. You need to specify the action that you want to perform and then transfer this action to the app. For instance, when you select “Calculator” from the list of apps, you can choose one of the actions connected to it (“Count”, “Round” etc.). If you select “Internet”, the actions will be the following: “Show the web-page”, “Open multiple URLs” and many more.
“Automation” button that can be found at the bottom of the app window is a type of shortcut that’s triggered by an event, rather than manually. For example, you can set a particular time for your shortcuts. But there are also less evident triggers: arrival to a particular place according to GPS data, switching to another mode or launching an app. For instance, you can set automatic switch to Low Power Mode when you leave home or come to work.
One of the most interesting Shortcuts' features is a simple set of switches which can help you configure triggers even more flexibly. You can find them in the “Scripts” section. Using this tool you can write a simple script that will perform a kind of primitive algorithm.
How to Use Shortcuts on iPhone?
Shortcuts work with the operating system’s API, to be more particular, they let you accept different parameters and dynamic input. These parameters can be processed by iOS applications in the background, which means without launching. Then the result is transferred to the “Shortcuts” app itself or to Siri. This is the difference btw. the updated “Shortcuts” and Siri of iOS 12. Previously, the interface of interaction between the operating system and applications was based on the x-callback-url mechanism. Now all actions are processed by “Shortcuts” or Siri. Such approach is more productive and offers more opportunities both to programmers and simple users.
Let's discuss the background mode in details. Imagine that you've decided to automate some processes on your iPhone or iPad with the help of Javascript and you're using special program for iOS “Scriptable” for this purpose. Scriptable is an iOS app that lets you write scripts that integrate with native features of the operating system such as reminders, documents, files, calendars, and much more. In other words, Scriptable helps you take your code, and integrate it with iOS.
Supposing that you've created several useful scripts, saved them to Scriptable, and decided to make a shortcut that would execute them under certain circumstances (e.x. timetable).  Open Shortcuts on iPhone and select «Run script». You will see a list of all saved scripts in Scriptable. Choose the necessary script. By the way, Scriptable won't launch, the “Shortcuts” app gets the needed data in the background mode.
At the user level, “Shortcuts” is a set of editable fields in the context of application features into which certain data can be transferred. When the shortcut is triggered, it receives data from the fields, processes it according to the algorithm selected by the user, and returns the result that can be saved or transferred.
"Shortcuts" can work with various types of data, including numerals, text, URLs, clipboard contents, and files. Moreover, developers can set the app in such a way that it supports their own types of data and parameters.
Interestingly, in iOS 12, Siri shortcuts couldn’t use the data entered by the user. If the voice command required to enter something on the keyboard or to select an option from the list, the command was interrupted and the corresponding app was launched. The user in his turn was expected to perform a desired action or the corresponding command. With Shortcuts everything has changed. If an interaction with the user is required to execute the algorithm, this interaction doesn’t interrupt the main script. The app “Shortcuts” is integrated with the Siri language and supports voice control. For instance, if a command is called up in Siri and implies text input, you can dictate this text.
Thus, the features of ”Shortcuts” are not limited to the set of tools of this app. In fact, they are not limited at all: you can easily create a set of apps
specifically for your tasks, and then get data from one app, convert it in
another app, and transfer it to the third app with the help of Shortcuts.
For instance, you can get current exchange rates from the Internet, compare them using a program that can work with this type of data (for example, the PCalc calculator), and then you can transfer the results of the calculations to Notes or share them via Telegram. You can even set the shortcut in such a way that it will automatically update exchange rates every time you connect to the Internet.
If you install FTP client on your device, you can automate downloading files to the server, viewing the contents of the server folder, etc. You can get the new data about the weather at your current location or at a given geographical point, copy it to the clipboard etc. By the way, you don’t need to enter the geographical point for which you determine the weather manually – it can be obtained as an input parameter from an event recorded in the "Calendar". These are just a couple of examples. The use of
Shortcuts can be limited only by your imagination.
Life Hacks for Shortcuts
Despite the fact that the “Shortcuts” app uses its own ideology of performing a user-defined sequence of actions, the principles of x-callback-url are still supported by the app. Federico Viticci, the founder and editor-in-chief of MacStories, has found out that with the help of special URLs one can access not only Internet resources, but also the “Settings” and even certain features.
This trick is quite simple. Some iOS control elements are hidden in the “Settings” rather deeply. And if you create a special shortcut with the address of the needed setting in Shortcuts and save it as an icon on the phone screen, it will be pretty easy to find it.
Apple doesn't have any documentation on this subject, so according to Federico Viticci, he spent several days manually selecting the appropriate parameters by trial and error. We won’t repeat this experiment and we’ll use his achievements to make the process easier and faster.
All the commands that grant access to the “Settings” and its components begin with the prefix prefs:root=. I often use Personal Hotspot on my iPhone - sometimes I need to connect my car navigator to the Internet so that it shows me traffic jams.  But to get to this feature, you need to run
the “Settings” app and to select the “Personal Hotspot”, meaning that you have to perform two actions. Let’s create a shortcut that opens this setting with one touch.
Open “Shortcuts” and select “Create Shortcut”. Tap “Add Action” and then tap on the Internet icon. Scroll down the list and select "URL-address".  In the URL panel, tap on the apple.com field and enter prefs: root = INTERNET_TETHERING instead. We've created a variable that stores the settings command instead of the URL-address. Now we need to transfer this variable to the application that will process it.
Tap the «+» button below, select «Internet» again, then select «Safari» and «Open URLs». This command will automatically pick up the address from the previous line, so you don't need to change anything. Surprisingly, if you simply enter prefs:root=INTERNET_TETHERING to the «Safari» command, → "Open URLs", the system won't be able to process it correctly.
Tap «Next» and enter a random name for the shortcut and the icon will appear in the «Shortcuts» window. Then tap and hold the icon, select the "Details" item in the context menu, and then tap on "Add to Home Screen" link and confirm the action by tapping the "Add" button. The icon will appear among other apps on the home screen. Now you can open the Personal Hotspot setting with one touch.
Conclusion
Though the features of Shortcuts on iPhone haven’t been fully explored yet, it’s clear that the app is really useful. Shortcuts let you create random sequences of actions with programs, process data, etc. If you come up with an unusual usage of this application, feel free to share your experience with me!






Tags

The Noonification banner

Subscribe to get your daily round-up of top tech stories!