I've changed the default app for opening webloc files to firefox (using RCDefaultApp, nice piece of kit, that) and that's all fine, except for one bit of weirdness. If I create a webloc using a script (I'm using a perl script adapted from this one to create spotlight-searchable bookmarks) then it opens up in firefox as a bit of unstyled XML (with the "This XML file does not appear to have any style information associated with it. The document tree is shown below" header.).
Now here's the weirdness: if I drag a url from the Firefox URL bar onto the desktop I get a webloc that is opened by firefox no problems - but when I look at the contents it's completely identical to the one I created with my script. It has to be something to do with the file creator - if I open the firefox-created webloc and then save it from a text editor it no longer works.
So what's going on? How do two identical bits of XML open differently depending on how they were created? Is there some magic bit somewhere I can change?
For reference here is the contents of a webloc as created by my script (I'd put the one created by firefox as well, but since it's completely identical (I checked with diff) there's no point):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>URL</key>
<string>http://www.spacetelescope.org/</string>
</dict>
</plist>
ls -l@ /path/to/file, and show their contents withxattr -l /path/to/file. – Gordon Davisson Jun 29 '11 at 9:03