Using Shortcuts and Data Jar to Store and Share Multiple Links
For a lot of us, searching the web for information to support research, decision-making, or writing is a common task. I’m sure everyone has their own preferred method for collecting URLs for stuff they want to reference later or share, but I’ve been really happy with the two shortcuts that I put together for this purpose.
At its core, these shortcuts allows you to collect any number of URLs to use at a later time. When you’re ready, you can run a separate shortcut to fetch all those URLs and send them as a list in an email. While this is a specific action (sending a list of links through email), you could alter it to do something different with the list of links, like send it to a specific app (like Ulysses), send them to a browser to open all at once for reading, use it as an ad hoc clipboard manager, or send them to a read-it-later service. The options are plentiful, and that’s the beauty of Shortcuts.
To get started, we need to understand one core concept. The two shortcuts either send information into a dictionary in Data Jar, or fetch information from that dictionary in Data Jar. It’s that simple. I’m using Data Jar in this case for data persistence. Shortcuts has its own version of dictionaries, but you can only use them while the shortcut is running. With Data Jar, I can send or retrieve information from the same dictionary over a long period of time.
The first shortcut in our example is called Add to LinkList. You use this shortcut to send information into Data Jar. It’s expecting some kind of webpage or URL, so let’s look at what happens once we start this shortcut from the share menu of Safari.
- The shortcut saves the URL and title of the page to individual variables.
- The shortcut checks if there are any links already present in the dictionary. If there aren’t, the counter starts at 1. If there are, it adds one to the count to represent the current link.
- The shortcut adds a text value to the dictionary that contains the following information: URL, Title, and the timestamp.
- The entry is saved to the dictionary as a text value at the following location:
links.yyyy-mm-dd.list1
, where yyyy-mm-dd is the actual current date. The next entry will be saved aslinks.yyyy-mm-dd.list2
, and so on.
I’ve set the shortcut up to collect entries based on the current date. If you want these dictionaries to span over several days, you can easily adjust the shortcut to use a different naming convention.
The Sweet Setup Staff Picks for 2022
We spend an inordinate amount of time sorting through hundreds of apps to find the very best. Our team here at The Sweet Setup put together a short list of our must-have, most-used apps in 2022.
Now, after you’re done with the research and need to share your list of links with someone, we run the Send LinkList Digest from within Shortcuts. This one is a little more complicated, but only because we are formatting the links as a Markdown list for an email. Otherwise, we’re just doing the opposite of the first shortcut: collecting each link entry from the dictionary.
- Since I’m sending this list as an email, I start the shortcut with some text for the beginning of the email.
- Get all the links from the current dictionary! Again, in my example I’m getting the dictionary from the current day. If you modify the first shortcut with a different naming convention, you need to change it here as well.
- Since the links are saved as value/key pairs, we have to parse the raw text to find the title, url, and timestamp. The next few actions use regular expressions to find exactly what we want. You don’t need to be an expert in regular expressions to use this!
- After we parse each component of the link (title and then URL), we combine them in the appropriate syntax for an unordered list:
* [title](url)
, and then repeat the loop for each item in the dictionary. - Once the shortcut has processed all the entries in the dictionary, it formats the contents of the text blocks as rich text, and then shows the contents as an email that’s ready to send. You can take this chance to add some commentary or any edits, or you can also turn off the Show Compose Sheet option in the shortcut step to send the email immediately.
When I started off with the idea of this shortcut, it seemed a lot easier to create. The interesting problem that this shortcut solves is being able to collect information across an arbitrary amount of time, and then being able to recall all of it when you’re ready to do something with it. It took quite a bit of time to perfect it, but I really enjoyed the learning process. With what I learned from using Data Jar dictionaries, I’ve already found other ways to improve other shortcuts in my collections. Even years after its debut, I’m continually surprised and impressed with what Shortcuts on iOS allows you to accomplish. And better yet, it just feels like magic when you run the shortcut and all this cool stuff happens in the background without a sweat.
Like I said at the beginning of this tip, this shortcut combo focuses on collecting and sharing a number of links through email. But, you can take the core functionality and customize it to do any number of things with the information you choose to collect. We’d love to hear how you branch this shortcut to fit your own needs!
We have more helpful tips right here.
Wait. There’s a Bonus….
Custom Productivity Templates
We have a set of custom productivity templates that work well with the iPad app, GoodNotes. And if you want to try them out, we’ve put together a free guide that can help you.
We’ll show you…
- How to create and save custom page templates in GoodNotes.
- How to use those page templates to transform GoodNotes into your own productivity notebook (or any other type of notebook replacement).
Plus, we also have included a couple of our custom productivity templates for you to get started with. These templates are right out of our popular productivity course.
The custom templates and the guide are available for FREE to our email subscriber community. And you can get it right now. By joining the Sweet Setup community you’ll also get access to our other guides, early previews to big new reviews and workflow articles we are working on, weekly roundups of our best content, and more.