Red Green Repeat Adventures of a Spec Driven Junkie

Shortcuts - Displaying and Modifying Alert

This is the second in a series:

Displaying Result

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.

Show Alert

On a new Shortcut, add a Show Alert by:

  1. Tapping: Add Action
  2. Searching for “Show Alert” in the “Search for apps and actions” section.
  3. Add the “Show Alert” under the Scripting section.

The Add Action section: Shortcut - Add Action

Find Show Alert: Shortcut - Show Alert

The Shortcut will now have an entry to Show Alert: “Do you want to continue?”

Shortcut - Default Alert

You can test the Show Alert feature by Pressing the ▶️ button and see an alert:

Shortcut - Test Default 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:

  1. Tapping the “Do you want to continue?” text.
  2. Enter new text - say: “This is your alert”
  3. Tap “Done”

Edt the Alert: Shortcut - Edit Alert

This is what the Edited Alert will show: Shortcut - Edited Alert

Test it out by pressing the ▶️ button: Shortcut - Test Edited Alert

What’s Next?

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.