Sunday, November 27, 2011

Too many bookmarks


I have LOTS of bookmarks in three different browsers. I use Safari, Firefox, and Google Chrome. I have given up trying to synch bookmarks between them. To help me find a bookmark from, say, "How to hyperlink Table of Contents in LibreOffice", I reached a certain inelegant solution.

I may  provide a more detailed write-up later, but here we go with the short version. 

Periodically I export my bookmarks into my ~/Sites/bm folder. To search through these quickly I wrote a short AppleScript program to pop-up a dialog, get a single search argument, and then call a shell script to do the heavy lifting.

My script does an mdfind for Bookmarks in ~/Sites/bm, pipes them to xargs and grep which looks for matches to the search argument. It uses grep again to select only lines containing "href=", sorts them, writes them to a temporary file, and finally opens that file in my default browser.

This tool works great to help me to find that interesting article I bookmarked three years ago on how to fry a penguin or something.

One other problem I had was that neither Firefox nor Google Chrome set permissions to 644 on the files they export. This means Apache can't read them from my "userdir". In order to be able to browse them I need to periodically turn on the "r" bits on the files in that directory.

In the past I used cron to do it, but Apple seems to prefer me to launchd, and so I decided to take the plunge and learn about it. More of that later.

0 comments: