Getting decades of bookmarks under control
Feb. 9th, 2022 04:26 pm I bought a copy of Markster from Sheep Systems and used it to scan 4000 Safari bookmarks to delete all the broken ones, remove duplicates, and upgrade http to https where appropriate. All fine, until I went to write back to Safari, and got a warning that one of my Bookmark folders had over 500 items in it. Markster refused to export unless I fixed Safari's bookmark list.
To fix that, I exported my Safari bookmarks to an export.html file, used Xcode to break out just the one offending folder to a separate file. I wrote a simple program to read that file in and sort, first by title and where the titles match by URL. I see now a clever call to the Unix sort command-line utility would have done the same thing, since all the lines looked like:
So the part after the second > is the primary key, and the part after the first > is the secondary key.
Then, by hand, I edited that, breaking it into sub-folders, edit that into the export.html, and read that back into Safari. Safari placed the entire export on the end of its Bookmarks list so I manually replaced the existing huge folder with the broken out, sorted, set of subfolders.
Then, back to Markster to remove duplicates, delete all the broken ones, and finally write it to Safari.
This made safari move all my Favorite bar items to the end of the Bookmarks list but it was easy to select them and drag them back.
I still have that huge, broken up folder in there, but at least now I know that it has no duplicates or dead links.
To fix that, I exported my Safari bookmarks to an export.html file, used Xcode to break out just the one offending folder to a separate file. I wrote a simple program to read that file in and sort, first by title and where the titles match by URL. I see now a clever call to the Unix sort command-line utility would have done the same thing, since all the lines looked like:
<DT><A HREF="http://bslabs.net/2015/07/18/porting-anypia-to-xcodeintel/">Porting SSA Calculator to Xcode</A>
So the part after the second > is the primary key, and the part after the first > is the secondary key.
Then, by hand, I edited that, breaking it into sub-folders, edit that into the export.html, and read that back into Safari. Safari placed the entire export on the end of its Bookmarks list so I manually replaced the existing huge folder with the broken out, sorted, set of subfolders.
Then, back to Markster to remove duplicates, delete all the broken ones, and finally write it to Safari.
This made safari move all my Favorite bar items to the end of the Bookmarks list but it was easy to select them and drag them back.
I still have that huge, broken up folder in there, but at least now I know that it has no duplicates or dead links.