skip to content
Site header image Nerdy Momo Cat

Apple Shortcuts Mini Course 30x

A step above beginner or almost intermediate tutorial/introduction to X. This time: Apple Shortcuts Automation 300. It is an intro to do(s), don't(s) and WTF is this thing in Apple Shortcuts.


Table of contents

This page is a work in progress

Beginner Questions

  1. What are shortcuts?

    Apple shortcuts are predefined series of commands that can be configured on all Apple Systems, iOS, MacOS, iPadOS, and watchOS.

    Apple shortcuts make use of internal or x-callback URLs to add, delete, modify system or app data.

  2. I use Automator on MacOS, do I need Shortcuts?

    Automator is generally more powerful than Shortcuts and has built-in initiation options that Shortcuts do not.

    However, if you want your automations to be accessible on both your phone and laptop, Shortcuts may be a better fit.

  3. But but, I am on Android. (Update Oct 20, 2023, so am I!)

    Then use Automate by LlamaLabs (https://llamalab.com/automate/)

    Yes, tasker is the "more popular" alternative, but in terms of UI/UX, Automate is the closest option you will find.

In programming, you would be familiar with the concept of flexibility.

Flexible is one thing Apple Shortcuts tries to be not. It will fight you every step of the way.

So, we will go over the functions that Shortcuts provide out of box. And the quirks that come along with it.

Primitives

  1. Constants and Variables

    Shortcuts has inbuilt constants in form of Text, Number, Boolean, Array and Dictionary.

    All objects are immutable in Shortcuts, i.e., changing any of these constants (mostly) returns a new object, rather than changing the original object.

  2. Operators

    Any programming language has 5 basic operators:

    (a) Equals
    (b) Not
    (c) And
    (d) Or
    (e) Contains

    Shortcuts has TWO: EQUALS/Not EQUALS and CONTAINS/Not CONTAINS.

    Remember this!


  3. Conditionals

    Usually comparisons can have multi-parts in normal programming languages: and or or.

    But we just learnt that shortcuts do not have and or as discussed above.

    So, if X or Y: i1 else: i2 in Shortcuts is if X: (i1 if Y: i1 otherwise: i2) otherwise: i2

  4. Loops

    You might be used to 4 kinds of loops: for range, for each, for until and while. You might also be used to 2 commands: break and continue when dealing with loops.

    Shortcuts only has TWO: For range (ex: run it 100 times), or For each (ex: run for each element in array)

  5. Inbuilt Objects

    Shortcuts also comes with an inbuilt set of objects. Each of these objects have pre-defined properties:

    1. There are 22 inbuilt objects.
    2. Each object has different inbuilt properties.
    3. Depending on the object, it presents with a set of conditionals.
    Images of all objects and their respective properties


    Inbuilt Object Conversions
    1. You can define that the object is a dictionary, boolean, number and text but you cannot define it is an array.
    2. Object conversions also have no warning. So, you can try converting a URL into a dictionary and you'll know only when you run it!