Export Safari Reading List Items

This is something I should have done a while ago, but recently I started using my reading list for managing more items than in the past. After finally searching I found they’re stored within Safari’s bookmarks data (~/Library/Safari/Bookmarks.plist).

Using the plist library the reading list item urls can be extracted using python.

#!/usr/bin/env python
import os
import plistlib

# load bookmarks plist into dict
relpath = 'Library/Safari/Bookmarks.plist'
fullpath = os.path.join(os.environ['HOME'], relpath)
plist = plistlib.readPlist(fullpath)

# get the reading list node
for child in plist['Children']:
  if child.get('Title', None) == 'com.apple.ReadingList':
    bookmarks = child['Children']

# extract urls from each
urls = (bookmark['URLString'] for bookmark in bookmarks)

Then the urls can, for example, be opened in a different browser.

open /Applications/Google\ Chrome.app $(~/bin/readinglist-urls.py)

Why bother, use Pocket or Instapaper?

It’s a more universal “save url for later” because often the iPhone will open a share sheet with only a few options that includes saving to the reading list.

Pocket for me is for longer posts or articles that I save for times where I can lounge in a comfy chair or when travelling. My workflow with Safari’s reading list is odd, but its a temporary bookmark list that I can saveĀ links from any webview in any app I use on my iPhone and then I can take action when I’m back on my MacBook.