Thanks for surfing with a better browser. Please consider changing your web browser.
February 24, 2003

Hacking Safari Bookmarks

Charles Miller asked Is there an AppleScripty way to manipulate Safari bookmarks? I'd like to be able to mirror my NetNewsWire subscriptions there.

Safari's AppleScript dictionary doesn't expose anything bookmark related. Maybe it will in a later beta release. In the meantime the bookmarks are stored as XML in ~/Library/Safari/Bookmarks.plist. I edited that file directly with the Property List Editor and successfully added bookmarks, though the editing would have been quicker in emacs. I basically copied other entries modifying values as appropriate. I made up the WebBookmarkUUID element (you'll have to look at the file to see what I'm talking about). I have no idea if the one I concocted will conflict with Safari's ID generation. Also, I had to quit and re-launch Safari for the bookmark to show up in the UI.

Posted 09:35 PM | TrackBack (0)
Comments

Can anyone tell me if this bookmarks XML file has been the same format since Safari came out? If I write an app that goes and edits this file, will it break in earlier versions of Safari?

Posted by: Rob Gould on January 22, 2004 11:26 PM
Email a comment

The comment form is broken. Please email your comments to blog-comment@dobbse.net.