Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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'
@cliffordp

This comment has been minimized.

Copy link

@cliffordp cliffordp commented Oct 22, 2013

Worked quickly and perfectly, but it also pulls my current bookmarks, which took a bit to realize what was going on. Very nice. Thank you.

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Dec 17, 2014

Worked perfectly. Thank you.

@BleedingEdge01

This comment has been minimized.

Copy link

@BleedingEdge01 BleedingEdge01 commented Dec 19, 2014

Is it possible to export the reading list URL's from Safari 5.1 and import them into Safari 7.1? I've noticed that they are embedded in the bookmarks.plist in Safari 5.1 but stored in a separate folder in Safari 7.1.
Any clarification would be greatly appreciated.

@terorie

This comment has been minimized.

Copy link

@terorie terorie commented Mar 24, 2018

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.

@ianhobbs

This comment has been minimized.

Copy link

@ianhobbs ianhobbs commented Jun 25, 2018

Works well !!

@j1nma

This comment has been minimized.

Copy link

@j1nma j1nma commented Oct 14, 2018

I can't get it to work on Mojave. Any help?

@hairybridget

This comment has been minimized.

Copy link

@hairybridget hairybridget commented Nov 2, 2018

I can't get it to work on Mojave. Any help?

Just figured this out. Mojave added extra security layers to everything, so you have to go into System Preferences > Security & Privacy > Privacy. Under "Full DIsk Access" add Terminal. After Terminal.app relaunches, rerun the script and it should work again.

@GitterRemote

This comment has been minimized.

Copy link

@GitterRemote GitterRemote commented May 26, 2020

very good, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.