Black-Box iOS Shortcuts and make them more secure

Black-Box iOS Shortcuts and make them more secure
May 13, 2020 No Comments Shortcuts Gatekeeper

Repeating stuff is probably the biggest area of improvement that we can identify. Each day we repeat tasks, we do things that… well, we always do. We have probably done them for so long that they have become habit, stuff we do without any thought. In this article we are going to address repetition in iOS Shortcuts and how we can ensure we capture them. You will learn not only how to build these repeaters but also see the benefit that they give to you.

The repetition of small efforts will accomplish more than the occasional use of great talents. Charles Spurgeon

BlackBox Game

We will look at a Shortcut that I wrote as part of my personal Project Workflow and I go on to explain in detail in my up-and-coming course entitled “Professional Project Management on an iPad”.

The Shortcut, entitled “New Project”, automates the creation of a new project into my Workflow. This entails the following:

  • Entry of the Project Title
  • Creation of a Unique Project Identifier (UPID)
  • Creation of a folder in iCloud to store any project material or deliverables.
  • Creation of an Apple Note which will hold my Project Journal. Create and store a unique identifier (UUID) for the Note.
  • Creation of an OmniFocus Project with the Note UUID for linking. Capture the OmniFocus link.
  • Update the Apple Note, identified by the UUID, with the link to the OmniFocus Project.

In this Shortcut there are a number of points that could be addressed as repeating functions but in this article we will only look to address the creation of the UPID, something that I use in other Shortcuts.

First thing to note, and I believe is probably one of the most important reasons for the extraction repeating functions, is that we add an unintentional layer of quality. As you will see when we build the Shortcut, there are a few rules that I want to be addressed, rules that can be managed in a single Shortcut so, rather than trawling through the Shortcuts and changing each one that needs to change, we change just one.

Let’s look at the rules that I want this Shortcut to follow: 

1. Unique means unique.

2. The UPID contains the project title.

3. The UPID starts with PKJ to show it is a project in my catalogue.

On with building the Shortcut. Please note that I use another iOS App called Data Jar in this shortcut.

The Repeating Actions

This is a simple section of a bigger Shortcut that contains actions that I repeatedly use elsewhere. I am also aware that there is a level of quality and responsibility in this function as it  must be unique and it must conform to a set format.

The fact that I use this consistently when creating projects and tasks means that in its current state it is open to errors. This is the main reasoning for moving the actions into a single Shortcut that is often referred to as a Black-Box. The reasoning for this title is quite simple. You have an input and you have an output, all you care about is that the output meets your requirements, you don’t need to know how or what actions created the result passed to you. Therefore the box is black but above all it is consistent, you can trust it.

Creating the Black-Box

  1. Open up a new Shortcut in the iOS Shortcuts app.
  2. Select the blue eclipse at the top right of the title. This will open up a “Details” windows where you can change the shortcut title, icon and colour. I add BB to the start of the title so that I can easily identify it later on.
  3. While still in the Details window you need to change the type of shortcut that you are creating, in this case it will be ShareSheet only so uncheck the Show in Widget button. 

The Shortcut Details should now look like the image Above.

  1. Select Done and we can return back to the main Shortcut page.

  1. It is always good practise to enter some details about the shortcut. Find the “Comment” action and place it into the new shortcut. Type in there a brief summary of what this is and  maybe add author, yourself, and date created.
  2. We now need to get the value passed to the Black-Box. Add a “Set variable” action and add the Shortcut Input to a variable name.
  3. Now we need to get the value stored in Data Jar. Make sure you create a key called projectNum with a value of 0 in the Data Jar app. There are other ways to store global value but I will not be going into those in this article.
  4. Next we need to increment the projectNum by one.
  5. The projectNum is now set with the incremented value so that it is ready for the next project.
  6. Finally, we build the UPID starting with PKJ followed by the updated projectNum. We then add a space, hyphen, space followed by the value passed to our BlackBox.
  7. The Black-Box is now finished and we can select Done in the top righthand corner.

Calling the Black-Box Routine

We are almost done, the only thing left to do is to add the code to the New Project shortcut that calls the Black-Box and passes the new Project Title to it.

  1. The Black-Box is expecting a value for the Project Title. Enter an action to ask the user to enter a value.
  2. We now need to run the Black-Box shortcut. Enter the Run Shortcut action found within the Shortcuts App.
  3. Select the shortcut to run and you will be presented with a list of shortcuts that you have in your library. This is where naming with BB at the front helps, especially if you have a couple hundred shortcuts.
  4. Expand the action by selecting the > after “Show More”
  5. Where it says “Input” enter the variable name by using ‘Magic Variables’
  6. Lastly, it is a good idea to set the “Show While Running” to off otherwise you will end up showing Shortcuts each time you execute the shortcut.

In Summary

The objective of this article was to introduce to you to the idea of the Black-Box. We created a shortcut that took an input, we then manipulated the input and finally created the output. This shortcut is now available to use whenever required and is very simple to include in other shortcuts.

Try looking at your shortcuts and find a group of actions that you use in other shortcuts. Now design a Black-Box, identify what input it needs and what output you want from it. Finally build the box itself.

Please send me your questions or requests

About The Author

Leave a reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.