Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Converting entire reading list into bookmarks?

Hey guys,


Long story short-

As the title suggests- I'm looking for a way I could 'convert' my entire Safari's Reading List into bookmarks?

I'm using Safari 7.1.7 on OS X Mavericks.



Long story long-

Every now and then I encounter some tutorial, or whatever, that I want to have reference too,

So I had been adding them to my reading list.


In the past, I could easily find what I was looking for,

But now my reading list has approx. 200-300 pages in it,

And the search tool is not always helpful, since the titles of the pages in my reading list, not always reflect the content.


So I thought it would be better to organise it under categories/directories,

But, as its name suggests, it is a reading LIST.


So I'm looking into a way I could 'batch-convert' all of my Reading List items into bookmarks, instead of having to go to each page one by one.


Any ideas guys?


Cheers

MacBook Pro with Retina display, OS X Mavericks (10.9.5), 15" Late-2013

Posted on Jul 12, 2015 7:12 AM

Reply
Question marked as Best reply

Posted on Jul 23, 2015 7:11 PM

As always, protect your data with a recent backup, preferably Time Machine, before executing any commands on the command line. Carefully read and understand what a command does before pressing the Return key as you do so entirely at your own risk. Be aware that future OS updates can break scripts and render them unusable.

Reading List bookmarks are stored along with Safari bookmarks in the ~/Library/Safari/Bookmarks.plist property list file. Although Safari has an option to export Safari bookmarks using the GUI, it does not have an option to export those from the Reading List. If all you want is a list of Reading List URLs, you can use Ruby on the command line to do this. First open a Terminal window and download the required Ruby gem, plist, which will install to /Library/Ruby/Gems/2.0.0/gems/plist-3.1.0:

sudo gem install plist


Type in your admin password when prompted. The following command will place a text file named ReadingListURLs.txt on the Desktop:

plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist|ruby -rubygems -e 'require "plist";puts Plist.parse_xml(STDIN.read)["Children"].select{|e|e["Title"]=="com.apple.ReadingList"}[0]["Children"].map{|e|e["URLString"]}' > ~/Desktop/ReadingListURLs.txt


If you want a bookmarks HTML file in the Netscape Bookmark file format that you can import into Safari bookmarks, you can use the Python script, readinglistreader.py. The following command will download a zip file from GitHub containing a folder of the ReadingListReader Python library, unzip the folder to the Desktop, remove the zip file, make readinglistreader.py executable by changing the file permission, and place on the Desktop a bookmarks HTML file of the Reading List bookmarks:

cd ~/Desktop; curl -LOJ 'https://github.com/anoved/ReadingListReader/archive/master.zip' && unzip ReadingListReader-master.zip && rm -f ReadingListReader-master.zip && chmod +x ReadingListReader-master/readinglistreader.py && python ReadingListReader-master/readinglistreader.py --show all --sortorder descending --bookmarks > ReadingList.html


For more info on options to specify for readinglistreader.py, read the README.md file in the ReadingListReader-master folder that was unzipped to the Desktop.


To import ReadingList.html, from Safari's menu bar, navigate to File > Import From > Bookmarks HTML File, locate and select the ReadingList.html file and press the Return key, or click the Import button. While in Safari, press the Command-Option-B keys to edit the bookmarks. You can add, delete, rearrange, and create folders and subfolders. To view them in Safari's Sidebar, click the Sidebar button in the toolbar, or navigate to Bookmarks > Show Bookmarks and click the Bookmarks button. In either case, the Reading List bookmarks will be in the Reading List Bookmarks subfolder of a folder named with an ISO 8601 date format. For example: imported 2015-07-23.

User uploaded file


Safari 8 (Yosemite): Use bookmarks

Safari 8 (Yosemite): Keep a reading list

https://github.com/anoved/ReadingListReader

https://rubygems.org/gems/plist/versions/3.1.0

http://plist.rubyforge.org

OS X Man Pages PLUTIL(1)

OS X Man Pages curl(1)

OS X Man Pages UNZIP(1L)

OS X Man Pages RM(1)

OS X Man Pages CHMOD(1)

1 reply
Question marked as Best reply

Jul 23, 2015 7:11 PM in response to AMI289

As always, protect your data with a recent backup, preferably Time Machine, before executing any commands on the command line. Carefully read and understand what a command does before pressing the Return key as you do so entirely at your own risk. Be aware that future OS updates can break scripts and render them unusable.

Reading List bookmarks are stored along with Safari bookmarks in the ~/Library/Safari/Bookmarks.plist property list file. Although Safari has an option to export Safari bookmarks using the GUI, it does not have an option to export those from the Reading List. If all you want is a list of Reading List URLs, you can use Ruby on the command line to do this. First open a Terminal window and download the required Ruby gem, plist, which will install to /Library/Ruby/Gems/2.0.0/gems/plist-3.1.0:

sudo gem install plist


Type in your admin password when prompted. The following command will place a text file named ReadingListURLs.txt on the Desktop:

plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist|ruby -rubygems -e 'require "plist";puts Plist.parse_xml(STDIN.read)["Children"].select{|e|e["Title"]=="com.apple.ReadingList"}[0]["Children"].map{|e|e["URLString"]}' > ~/Desktop/ReadingListURLs.txt


If you want a bookmarks HTML file in the Netscape Bookmark file format that you can import into Safari bookmarks, you can use the Python script, readinglistreader.py. The following command will download a zip file from GitHub containing a folder of the ReadingListReader Python library, unzip the folder to the Desktop, remove the zip file, make readinglistreader.py executable by changing the file permission, and place on the Desktop a bookmarks HTML file of the Reading List bookmarks:

cd ~/Desktop; curl -LOJ 'https://github.com/anoved/ReadingListReader/archive/master.zip' && unzip ReadingListReader-master.zip && rm -f ReadingListReader-master.zip && chmod +x ReadingListReader-master/readinglistreader.py && python ReadingListReader-master/readinglistreader.py --show all --sortorder descending --bookmarks > ReadingList.html


For more info on options to specify for readinglistreader.py, read the README.md file in the ReadingListReader-master folder that was unzipped to the Desktop.


To import ReadingList.html, from Safari's menu bar, navigate to File > Import From > Bookmarks HTML File, locate and select the ReadingList.html file and press the Return key, or click the Import button. While in Safari, press the Command-Option-B keys to edit the bookmarks. You can add, delete, rearrange, and create folders and subfolders. To view them in Safari's Sidebar, click the Sidebar button in the toolbar, or navigate to Bookmarks > Show Bookmarks and click the Bookmarks button. In either case, the Reading List bookmarks will be in the Reading List Bookmarks subfolder of a folder named with an ISO 8601 date format. For example: imported 2015-07-23.

User uploaded file


Safari 8 (Yosemite): Use bookmarks

Safari 8 (Yosemite): Keep a reading list

https://github.com/anoved/ReadingListReader

https://rubygems.org/gems/plist/versions/3.1.0

http://plist.rubyforge.org

OS X Man Pages PLUTIL(1)

OS X Man Pages curl(1)

OS X Man Pages UNZIP(1L)

OS X Man Pages RM(1)

OS X Man Pages CHMOD(1)

Converting entire reading list into bookmarks?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.