Reputation: 11
I would like to set a custom icon onto a webloc file.
I've written this code:
<?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://blabla.com</string>
</dict></plist>
Does a specific key exist for setting icon?
The URL file I use for Windows contains "IconFile" key, what about webloc file ?
Thanks for your help,
Upvotes: 1
Views: 2470
Reputation: 73
There is no key to an icon for the .webloc file.
This is due to the fact that a file's icon is not stored in the file, but as a Finder property, externally to the file. The regular way of changing the icon of a file or folder works on a .webloc file, though.
A consequence is that if you send the .webloc file by mail, the icon you previously set is lost. It is preserved if you copy the .webloc file from one Mac to another, e.g. via a (Mac-formatted, I guess) USB key. It is also preserved if you mail a ZIPped folder containing the .webloc file, since the associated icon is stored in the folder.
Note that the .url file format does not contain the icon either: the IconFile
field stores a reference to a file on your disk.
Upvotes: 2