Ah, I see. I thought you wanted all of them changed.
> Other articles suggest, eg, that the .webloc extension is changed e.g.
> to a .text file, which can have its Open With changed, and then changed
> back to .webloc. I can't recollect the details now, but if you do
> succeed in changing the default then it is changed for all oher weblocs,
> i.e. the default browser is changed.
>
> As a matter if interest, did you try changing Open With on a .webloc on
> your Mac, and with what result?
I get the same error you did when trying to change an individual file.
When you change a text file to be opened by Chrome instead of the
default TextEdit, then the text file has an extended attribute set which
tells LaunchServices to handle that particular file differently.
In terminal:
$ xattr -px com.apple.LaunchServices.OpenWith test.txt
62 70 6C 69 73 74 30 30 D3 01 02 03 04 05 06 57
76 65 72 73 69 6F 6E 54 70 61 74 68 5F 10 10 62
75 6E 64 6C 65 69 64 65 6E 74 69 66 69 65 72 10
00 5F 10 2B 2F 55 73 65 72 73 2F 62 72 75 63 65
2F 41 70 70 6C 69 63 61 74 69 6F 6E 73 2F 47 6F
6F 67 6C 65 20 43 68 72 6F 6D 65 2E 61 70 70 5F
10 11 63 6F 6D 2E 67 6F 6F 67 6C 65 2E 43 68 72
6F 6D 65 08 0F 17 1C 2F 31 5F 00 00 00 00 00 00
01 01 00 00 00 00 00 00 00 07 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 73
Unfortunately it is a binary blob of data, rather than XML or something
more readable. A quick scan of the Internet suggests that it is a binary
plist containing a dictionary with 3 keys but I can't easily find the
values needed for Chrome.
So I then tried copying the contents of the webloc file over the top,
but making sure to retain the xattr. The result, unfortunately, still
fails to open in Chrome.
And I thought it was just Windows that excelled at this kind of dicking
about with magic bits of binary...