Shortcuts - Displaying and Modifying Alert
This is the second in a series:
In programming, I find getting to a form of feedback the most important part of programming. How does one know what they are doing is producing any changes?
Writing tests first is a great way of validating changes.
With Shortcuts - the best test is to display a result. The way I display a result is to use the “Show Alert” Shortcut.
Doing this before getting any input is essential because after receiving input, displaying it will validate the system received input.
On a new Shortcut, add a Show Alert by:
- Tapping: Add Action
- Searching for “Show Alert” in the “Search for apps and actions” section.
- Add the “Show Alert” under the Scripting section.
The Add Action section:
Find Show Alert:
The Shortcut will now have an entry to Show Alert: “Do you want to continue?”
You can test the Show Alert feature by Pressing the ▶️ button and see an alert:
Modifying Show Alert
Showing this alert in the current form is not useful, so modifying the alert will be important.
At this time, modify the text for Show Alert by:
- Tapping the “Do you want to continue?” text.
- Enter new text - say: “This is your alert”
- Tap “Done”
Edt the Alert:
This is what the Edited Alert will show:
Test it out by pressing the ▶️ button:
Adding and editing an alert is an important first step in programming with Shortcuts. One can use the alert to give you information - such as which step is happening.
On the next part, hooking up the alert to a numeric input will start to close the input-output feedback loop.