Wednesday, December 8, 2021
Apps

Exporting Links from Safari Reading List via Shortcuts for Mac


A few weeks ago in the second lesson of the Automation Academy for Club MacStories+ and Club Premier members, I wrote about how I’ve been using Reminders as a read-later app in addition to traditional task management. The full details are in the story, but to sum up: using a combination of shortcuts based on Apple’s native actions, I can use Reminders to choose between long and short stories whenever I’m in the mood to read something. I love this setup, and I’ve been using it for nearly three months now.

Earlier this week, however, I realized I still hadn’t re-imported old articles from Safari Reading List – my previous read-later tool – into Reminders. That immediately posed an interesting challenge. Sure, I could manually re-save each article from Safari Reading List to Reminders, but that sounded like a chore. Other read-later apps such as Reeder and GoodLinks have long offered Shortcuts actions to fetch links from their databases and process them in Shortcuts however you see fit; Reading List, like other Apple apps, doesn’t support any actions to get the URLs you previously saved. And that’s when I had an idea.

Now that it’s available on macOS, Shortcuts can get access to application support files that are kept private and hidden from users on iOS and iPadOS. More specifically, I remembered that Safari for Mac has long stored its bookmarks and Reading List items in a file called Bookmarks.plist, which folks have been able to read via AppleScript for years. Under the hood, a .plist file is nothing but a fancy dictionary, and we know that Shortcuts has excellent support for parsing dictionaries and extracting data from them.

The plan was simple, and I knew what to do.

Reading List Exporter

To make the process of migrating from Safari Reading List to other read-later apps easier, I created a shortcut called Reading List Exporter.

The shortcut is built entirely with native actions – no scripting necessary – and it reads Safari’s Bookmarks.plist database without modifying it (your data is safe and this shortcut is read-only). With Reading List Exporter, you can automate the process of batch-exporting URLs from Safari Reading List and save them all at once in other read-later apps, the clipboard, or a plain text file. If you’re a Club MacStories+ or Club Premier member, you can even integrate this with the Reminders read-later system I described here.

ALSO READ  BT wants all operators to have equal access to street furniture

Reading List Exporter was designed to run on a Mac: the Bookmarks.plist file stored in ~/Library/Safari/ can only be accessed via Shortcuts’ ‘File’ action on macOS. Upon installing the shortcut, you’ll be asked to select the Bookmarks.plist file stored in the ~/Library/Safari/ folder in Finder. Select the file in the import question, and you’re good to go in terms of running this shortcut on Monterey.

If you don’t see the Library folder in Finder, there are a variety of ways to make it visible. The easiest method:

  • Press ⇧⌘H in Finder to view your Home folder;
  • Press ⌘J to open Finder’s View Options inspector;
  • Select ‘Show Library Folder’

As long as you find a way to make the Library folder visible in Finder and can select the Bookmarks.plist file in ~/Library/Safari/ from Shortcuts, you’re good.

You can also run Reading List Exporter on iOS and iPadOS, but you’ll have to manually copy the ‘Bookmarks.plist’ file into iCloud Drive first. The disadvantage of this approach is that you won’t be working with a live version of Safari’s database – meaning that if you save new items to Reading List, you’ll have to export the Bookmarks.plist file again. That said, it’s totally fine to run the shortcut on iPhone and iPad once you have the Bookmarks.plist file saved somewhere.

I won’t bore you with the technical details behind how I created this shortcut, but there’s a point I want to highlight. Previously, accessing and parsing Safari’s Bookmarks database would have required searching Google for some finicky piece of AppleScript code that doesn’t always work and is incomprehensible at a glance. This is why I find Shortcuts’ arrival on macOS such a big deal: it makes this kind of advanced automation more approachable and reliable for power users too. Those who believe that “real automation requires scripting” ignore how much easier (and shareable with others!) complex automations can be because of Shortcuts. In the screenshot below, you can see how I parsed Apple’s intricate .plist structure with just a handful of visual blocks in Shortcuts.

ALSO READ  Payment issues remain major issue for tech savvy small businesses

But back to Reading List Exporter. After you’ve the selected the Bookmarks.plist file (and you only need to do this once), you’ll be presented with a menu containing a variety of actions to export your URLs. For instance, I added the ability to batch export all URLs from Reading List to the most popular read-later apps:

These apps are all supported by native actions in Shortcuts. If your favorite app isn’t listed in the shortcut and offers a native action, it should be easy enough for you to modify the Menu and add the app you want to use. Personally, I ran this shortcut and exported all my URLs to Matter as a text, and it worked perfectly.

Unfortunately, I couldn’t add support for Pocket: while Shortcuts does have a Pocket action to save URLs, the action is currently broken in the Shortcuts app and won’t let me authenticate with my Pocket account.

Reading List Exporter also supports these actions:

  • Pick a URL from the list and reopen it in Safari;
  • Preview all URLs with Quick Look;
  • Copy all URLs to the clipboard;
  • Save all URLs to a plain text file.

The ability to export a plain text list of all URLs from Reading List is particularly handy if you’re planning to move these URLs to Obsidian or script them in some other way.

Reminders Integration

If you’re a Club MacStories+ or Club Premier member, Reading List Exporter supports the Save Article shortcut I shared here to use Reminders as a read-later app. Specifically, Reading List Exporter will export each URL to Reminders and automatically categorize it as a long read or short read.

ALSO READ  New iPhone 11 release date, price, news and leaks

To export your Reading List items to Reminders, make sure to re-download my ‘Save Article’ shortcut, which I have updated with support for Reading List Exporter. Then, run Reading List Exporter on iOS or iPadOS and, depending on the size of your Reading List database, wait a while as the shortcut needs to parse each URL as an article, get its word count, and save it. Again, due to current limitations of Shortcuts for Monterey, this action isn’t supported on macOS at the moment; you’ll have to run this step on iPhone or iPad.

For more details on my read-later setup in Reminders, check out this lesson of the Automation Academy.

You can read more about Club Premier here, then sign up or upgrade your account using the buttons below:

Download Reading List Exporter

Reading List Exporter is, in my opinion, the perfect example of the new possibilities for user automation unlocked by Shortcuts for Mac. Apple never built actions to extract URLs previously saved to Reading List, but, because of Shortcuts for Mac, that doesn’t matter anymore. With the Finder’s ability to view the entire filesystem and Shortcuts’ built-in dictionary actions, we can now easily and quickly open the Reading List database, find all URLs contained in it, and do whatever we want with them. The combination of Shortcuts’ intuitive design and the freedom of macOS is precisely why I’m so excited about Shortcuts for Mac and its potential to reimagine desktop automation.

You can download Reading List Exporter below and find it in the MacStories Shortcuts Archive.





READ SOURCE

Leave a Reply

This website uses cookies. By continuing to use this site, you accept our use of cookies.