March 30th, 2006
Export Firefox Bookmarks to Safari
Firefox on OS X sucks. Big time. I decided to move to Safari, but I couldn’t do that without exporting my bookmarks. Here’s how I did it:
The Firefox bookmarks is in an HTML file. It’s typically located at ~/Library/Application Support/Firefox/Profiles/<profile name>/bookmarks.html. Safari stores its bookmarks at ~/Library/Safari/Bookmarks.plist, which is a binary file.
Use this simple script to export your Firefox bookmarks as a readable XML, and follow these steps:
renegade:~ $ ruby ff2safari.rb > ~/Library/Safari/Bookmarks.xml renegade:~ $ cd ~/Library/Safari/ renegade:~/Library/Safari $ mv Bookmarks.plist Bookmarks.plist.backup renegade:~/Library/Safari $ plutil -convert binary1 -o Bookmarks.plist Bookmarks.xml
Note that this script simply dumps all your Firefox bookmarks in Safari’s Bookmarks Bar. (I have a very few bookmarks on my browser, most of which are in the Bookmarks Toolbar.) You could use an XML parser to export bookmarks as is. To understand the format of the XML you need to generate, you might want to export the existing Safari Bookmarks file to XML:
renegade:~/Library/Safari $ plutil -convert xml1 -o readable.xml Bookmarks.plist
One interesting thing to note: a ktrace/kdump on Safari didn’t do any open on Bookmarks.plist. I wonder why.
This post brought to you from Safari.



