Skip to content

Instantly share code, notes, and snippets.

@williamli
Forked from andphe/gist:3232343
Created November 25, 2020 05:39
Show Gist options
  • Save williamli/521bed2cc06ea4ca83ea31957889e685 to your computer and use it in GitHub Desktop.
Save williamli/521bed2cc06ea4ca83ea31957889e685 to your computer and use it in GitHub Desktop.
Export your links from Safari reading list
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'
@williamli
Copy link
Author

williamli commented Nov 25, 2020

https://gist.github.com/andphe/3232343#gistcomment-2390914

Piping to open -f opens everything in TextEdit which is much nicer, imo.

/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g' | open -f

You don't have to remember this line, the following command will create a script called ExportReadingList.command and opens finder to show it to you.

printf '#!/bin/bash\n'"/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g' | open -f\n" > ExportReadingList.command && chmod +x ExportReadingList.command && open -R ExportReadingList.command

Whenever ExportReadingList.command is executed (from Finder), it will open TextEdit with the current reading list and bookmarks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment