I have a bunch of bookmarks I was keeping in folders on my Mac as
.webloc files. I still want the bookmarks, but I don’t want all these tiny files cluttering up my drive, so I wrote a quick script called
webloc2md. The script takes a single argument, the target directory, and outputs the links as an unordered list formatted with Markdown. The list is output directly, you can pipe it into the file of your choice.
One caveat: the
.webloc files must be in XML format. If not, the script will skip them, and output a warning as the last list item. You can use the program
plutil to do the conversion. To convert all the
.webloc files in the current directly, type
plutil -convert xml1 *.webloc.