How to sort bookmarks in Safari (Mac only)

A few years ago I read a book that gave some tips on getting organized. Among the other tips, the book suggested to keep a file cabinet with folders organized by name, so papers could be filed away and retrieved quickly when needed. I implemented this concept and found it very useful. I don't have to think if a piece of paper is an invoice, a letter or a contract. I just file it under a name and since names are sorted alphabetically it becomes very easy to find what I need later.

This concept of sorting alphabetically is implemented everywhere, especially on computers but there's still one piece of software that I use every day that apparently doesn't think this sistem works. It's my web browser Safari.

Safari is a fast, modern browser that comes with every Macintosh. It's a reliable piece of software and has a nice, polished interface that integrates well with other Apple programs.
Like everyone else, while I browse the internet I often find interesting web pages that I want to bookmark so I can visit them later.
Instead of keeping all my bookmarks in one long list, that would be difficult to navigate, I created several folders in Safari so I can have my bookmarks organized by category.
I have a News folder, a Forums folder, a Blogs folder and so on.

If I click "Show all Bookmarks" Safari presents me with a three pane view of all my bookmarks. Folders are neatly organized in the left pane. If I click on a folder I can see, in the bottom pane, the list of bookmarks that belong to that folder.
When I select a bookmark, in the top pane I can see a preview of the web page associated with it and if I want to navigate to that page all I have to do is hit the space bar and it will be loaded in the main window.
I can even search through all the bookmarks for text that appears in the web page referenced by it. Very neat.

All these neat functionalities make web surfing quick and painless. You can tell the engineers that worked on this software had a clear idea of what a good web experience is. But there's is a flaw that bugs me.

Safari's flaw

This flaw has never been addressed in all the years that Safari has been on the market. It's a small detail that you would think is simple to fix but still has no solution. The problem is: you can't sort bookmarks alphabetically.

When you add a bookmark to a folder it will be placed to the end of the list of bookmarks that are already there, regardless of its name. If you want to organize your list you can drag them up or down manually, but that's annoying if you have many bookmarks. Personally I find it easier to find a bookmark if I look through a list of items sorted alphabetically.

If I only have few items in a folder I don't really care because I can find them easily anyway. But when items start to pile up it becomes frustrating finding the one I am looking for.
I can't believe this problem has never been addressed by Apple so far. It sure is a simple problem to solve, and other web browser like Firefox can easily sort alphabetically, but apparently this feature is not at the top of Apple's list of priorities.

For a while I ignored the problem but finally I decided to do some research on the internet to see if I could find a solution.
Apparently, it's a problem that many people have because the question often comes up in various forum posts: "How do you sort bookmarks alphabetically in Safari?"

One of the solutions proposed is a little kludgy.

It involves dragging the bookmark folder that you want to sort to the desktop. This will convert it to a regular desktop folder where items are sorted by name. Then you drag the folder back to Safari e voila', your bookmarks show up properly sorted.
What I don't like about this approach is that now I have two bookmark folders in Safari, the old one with the unsorted bookmarks and the new one that I just dragged back in. At this point, I have to remember to delete the old unsorted folder so I have only the correct one. And I have to remember to delete the folder that's still on my desktop.
Too much trouble dragging and deleting just to have a list sorted.

The second solution is much more straightforward.

There is a little utility, called Sortosaurus that does just this. It sorts Safari bookmarks.
It's a little Terminal script that can be downloaded from this site and launched by double clicking it.
If Safari is running, the script will ask you to quit it. Then it will go about its business of sorting bookmarks and a few moments later, when you restart Safari, your bookmarks will be neatly sorted by name.

That's all there is to it, a neat little script that does one thing and one thing only, but it does it well and solves my little problem.

In summary

Apple has created a web browser that works well and is curated in every detail except one: you can't sort bookmarks alphabetically.
There are a couple of solutions to this problem: a clumsy do-it-yourself solution that involves dragging and deleting folders and a better solution provided by a small script funnily called Sortosaurus.
Sortosaurus does only one thing: sort your bookmarks so you can look for them more easily.

Now, when I scroll through my bookmarks I can quickly find what I was looking for, like when I search an old bill in my file cabinet.