Launch Center Pro Shortcut Adder13 Jan 2019
The latest iteration of the iOS app Launch Center Pro comes with an option to use a Shortcuts shortcut to add launchers for shortcuts to Launch Center Pro. It allows you to grab a shortcut from Shortcuts, and to set the launcher icon and the launch URL in Launch Center Pro. Very meta, and very cool. However, I have a lot of shortcuts. I’m often at the four figure mark, and it just doesn’t give me the ease of set-up I need, and also I often like to run my shortcuts via a shortcut launcher to speed things up. To that end, I took it upon myself to produce an enhanced version of the original shortcut.
You can download my enhanced shortcut - LCP Run Shortcut freely, but I would recommend that you skim through the details below prior to running it.
There are three enhancements that I have made to the original shortcut.
- Launch Method: Provide options to run shortcuts without displaying the full shortcut.
- Post Launch: Provide an option to automatically add a return to Launch Center Pro after running the shortcut.
- Sorted Shortcut Selection: Provide sort and filtering options for the selection of a shortcut.
When the shortcut is run (directly), it will display several menus to the user to build up the framework for the shortcut launching. It begins by prompting the user to select a launch method.
I added this option in to speed up my shortcuts. When version 3 of Launch Center Pro was launched, I was really impressed by the speed of the app start-up and the speed of launching things. When it came to running shortcuts, it actually felt like things suddenly hit a slow down. Apart from clever algorithms and generally reducing the number of actions in a shortcut, another way to speed up a shortcut is to run it ‘invisibly’. By this I mean call one shortcut from another with the Run Shortcut action, and the option to show while running turned off. Because Shortcuts doesn’t have to animate and redraw the page, it can run the shortcut more efficiently. For more long/complex shortcuts this can make a huge difference, and you can read about making use of this in a previous post.
What does this first menu actually do, you might ask? Well the first option for “Direct call of shortcut” will set the basic approach of the shortcut to do just the same as the original shortcut. It will put a URL into Launch Center Pro that triggers the shortcut and it will run that shortcut ‘visibly’.
The second and third options both provide ways for indirect running of a shortcut such that it will be run ‘invisibly’ as described above.
“Indirect call via ‘LCP Run Shortcut’ shortcut” will actually use itself to instigate this behaviour. If you look at the steps in the shortcut, you’ll see it immediately captures any parameter coming in and if there is one, it will attempt to run it as a shortcut. Failing that, it will begin running through the installation procedure. It’s for this reason I named the shortcut as I have. If the name of a shortcut is passed into this shortcut as a text parameter, it will be captured and run ‘invisibly’.
The final option of “Indirect call via ‘Quick Run’ shortcut” works in just the same way as for the “LCP Run Shortcut”. The difference is that the shortcut that it uses has no checking for if the parameter exists, working on the premise that it always will. It is also so short on the page, that it will never scroll during execution. In practical terms I’ve not seen any notable difference in speed between the two shortcuts, but not everyone on every device may necessarily have the same experience. Plus I already had Quick Run Shortcut in place and in use - see my earlier post for details and the shortcut.
The next menu is a choice of post launch action.
The first option, “Stay in shortcuts” will simply execute the shortcut and things will finish there. This once again is as per the original shortcut released with Launch Center Pro.
The second, “Return to LCP” will append some extra parameters to the launch URL to be stored in Launch Center Pro. These parameters will return the user back to Launch Center Pro once the shortcut has completed execution. I added this option as I found I would often be doing one thing from Launch Center Pro, and then want to follow that up with something else. Being returned automatically just reduced a bit of the friction.
Sorted Shortcut Selection
The final menu provides several options for displaying the list of shortcuts that is presented to the user to select from. This is what makes it much faster for me to choose my shortcut.
The first two options will return all shortcuts whilst the last two will return a sub-set based on the name of the shortcut containing text entered by the user.
Alphabetical sorting selections will sort on the name, whereas the ‘latest first’ ones will sort reverse chronologically. I used last modified date, but creation date worked just the same for me. I had expected to be able to distinguish between the two, but it didn’t seem to work like that in practice.
Having these options lets me find the shortcut I want much more quickly than not applying any filtering/ordering when the volume of shortcuts to search through is large. I have hundreds of shortcuts so without this there is a lot of scrolling up and down involved to find just the right shortcut.
One thing to note is that the filtering is case sensitive.
Photo ≠ photo ≠ PHOTO
I’ve implemented case insensitive filtering in Shortcuts before, but it was more than I needed for this particular use case. If you wish to revise my enhanced shortcut further to accommodate this, keep the following in mind.
Iteration is Slow Iterating through all the shortcuts individually is very slow when you have a large library of shortcuts, but lower casing everything and matching against that, then building your list from that would be considerably faster.
Concatenated Filters Concatenating multiple filtered sets (think filters based on
OR) should be much faster than iterating.
The trick is to apply the right filters. Think upper case, lower case and capitalisation as your minimum set.
What happens then if you wanted say “iPhone”? None of the above would match it and if the user had typed it into the app in a mismatching case too … well, things can be inadvertently omitted.
It can also lead to duplication so some consideration to deduplication should be given, though for most, this may be something that would not occur or could be put up with.
Whilst it is certainly possible to do case insensitive searching, you will probably end up needing to ensure that everything lines up, so you may want to tweak the source query as well as the source data.
Beyond the elements above, if you compare the revised custom shortcut to the original you’ll also see some differences in the way I’ve structured the building of the import URL, but this was just to make it easier for people to follow what was going on overall as I added some extra complexity overall to how the URL is built.
That should pretty much cover the differences. It has worked perfectly for me so far, but there’s always a chance I’ve missed something, or that it will have difficulty coping with an unusual shortcut name, etc.
In addition to being able to download the shortcut, I’ve also included a screenshot below that shows the full detail so you can get a clearer idea about what it is doing.