Webloc files are the handy little URL “aliases” that Mac OSX makes when you drag a URL from your web browser into a file folder. I’ve used them quite a bit to organize links I want to keep for various reasons.
If you’ve ever needed to convert a directory of “webloc” files into text suitable for pasting into an email or document, you want this handy little command:
grep -h http *.webloc | grep -v apple.com | sed -e 's/<string>//' | sed -e 's/<\/string>//'
To use it, open up the terminal window, cd to the directory which has the webloc files, and type the above command. It will output a list of URLs to the shell that you can easily cut-and-paste into your document.
Update 10-14-09: Just realized that the formatting had gotten messed up in the html encoding, the posted command has been updated now to actually work.
Discussion
No comments for “Making Text out of Webloc Files”
Post a comment