Portable Dictionaries in Shortcuts

December 17, 2018 by Gabe | [mmd] |

Many of my Shortcuts rely on dictionaries as a sort of switch statement. For example, I choose from a dictionary list which then modifies a DEVONthink To Go URL scheme and routes new documents based on my selection.

Dictionary Select

It works marvelously but since Shortcuts doesn't make it very easy to reuse dictionaries, it can be tedious recreating them from scratch in each new shortcut. That is, until I realized that Shortcuts dictionaries can be created from raw JSON.

I create the dictionary once and then route that to my clipboard...

Clipboard

Now I have the JSON that is the foundation of the specific dictionary. I can reuse this dictionary by reading it in as text to a "Choose from List" action...

JSON Text

I could also route this JSON and save it in iCloud Drive instead of the clipboard. In the future I then read it into any shortcut that needs to reuse the same dictionary. The great thing about this method is that I can edit the single JSON text file (in Textastic for example) and the change is made to all of my shortcuts that use this dictionary.

JSON Edit

Of course, it would be a lot easier if Shortcuts had "copy and paste" of actions and action blocks but this is a pretty good workaround for dictionaries. My hope is that Shortcuts improves the editor with reusable dictionaries and better reuse of custom actions across Shortcuts. It's hard to make a power user programming environment that is also approachable for people that have never created a custom script. The current Shortcuts app is failing at both in my opinion. This workaround is a hack, not a feature.

tags

Older articles

  1. Goodbye Katie

    December 15, 2018 by Gabe | [mmd] |

    "Change is the essential process of all existence." — Spock1

    I've listened to podcasts since before people knew what to call them. It was way back in the days when we loaded MP3's on chunky iPods so we could listen to other geeks talk about weird computer tricks ...

  2. AlphaFold @ CASP13: “What just happened?”

    December 13, 2018 by Gabe | [mmd] |

    AlphaFold @ CASP13: “What just happened?” « Some Thoughts on a Mysterious Universe

    What is worse than academic groups getting scooped by DeepMind? The fact that the collective powers of Novartis, Merck, Pfizer, etc, with their hundreds of thousands (~million?) of employees, let an industrial lab that is a complete outsider to ...

  3. Does Australia's access and assistance law impact 1Password?

    December 12, 2018 by Gabe | [mmd] |

    Does Australia's access and assistance law impact 1Password?

    One of the most disturbing things about the Assistance and Access Act is that it apparently authorizes the Australian government to compel someone subject to its laws to surreptitiously take actions that harm our customers’ privacy and security without revealing that ...

  4. Fighting the Insomnia Machine

    December 12, 2018 by Gabe | [mmd] |

    I try to avoid writing prescriptive blog posts. One man's top ten list is another person's junk science. But sometimes a nut of an idea can stick and help the next poor shmuck down the line. So this is my struggle with insomnia.

    I've had insomnia on ...

  5. Cooltools Concept Map

    December 09, 2018 by Gabe | [mmd] |

    Cooltools is a fun site but I’m linking to this post because I love this definition of concept mapping. I’m a big fan of concept mapping when I’m trying to solve problems. It’s a hard thing to grok.

    And, what it really does is, you construct ...

  6. Taking Notes on an iPad with LiquidText

    December 08, 2018 by Gabe | [mmd] |

    This article has taken me a long time to write because every time I go into LiquidText I end up reading for way too long. That's a sign of a great reading app, if you ask me. But, LiquidText isn't a reading app, it's an annotation app ...

  7. Creating Flow with OmniFocus 3

    December 08, 2018 by Gabe | [mmd] |

    I'll be honest, I enjoy reading productivity books about as much as I enjoy reading about riding a bicycle. I just don't find the advice very useful in my own life. "Productivity" books can feel a lot like a pyramid scheme where each subsequent author retells ideas from ...

  8. The Toxic Fragility of Siri Shortcuts

    December 06, 2018 by Gabe | [mmd] |

    I have a daily routine that should involve Siri Shortcuts. I have two custom actions to control HomeKit scenes in my house. In the morning it sets my bedroom, hallway, and kitchen to 20% light when I say "I'm Awake". At night I say "I'm in bed" and ...

  9. Resisting the Grind

    November 24, 2018 by Gabe | [mmd] |

    Warning Signs: President Trump May Violate Federal Law in Absolving Saudi Crown Prince | Just Security

    As the conservative editorial board of the Wall Street Journal wrote, “we are aware of no President, not even such ruthless pragmatists as Richard Nixon or Lyndon Johnson, who would have written a public statement ...