Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Assign custom default icons System
I found myself being annoyed by the fact that .doc files written by TextEdit.app had a generic, blank file icon. If you feel the same way, try this. Make a custom .icns format icon and place it in /Applications -> TextEdit.app -> Contents -> Resources. Open the file /Applications -> TextEdit.app -> Contents -> Info.plist in your favorite text editor. To the <dict> tag pertaining to Microsoft Word Documents, add the following:
  <key>CFBundleTypeIconFile</key>
  <string>word.icns</string>
The name of your custom icon should be used where it says word.icns. Now update the launch services database with the command:
/System/Library/Frameworks/ApplicationServices.framework/Versions\
/A/Frameworks/LaunchServices.framework/Versions/A/Support/\
lsregister  -v -f /Applications/TextEdit.app/
By extension (no pun intended), you can use this to assign a custom icon and default application for any file extension or pre-OS X file 'type' by adding a new <dict> entry with appropriate keys (see below) in the application's Info.plist file:
  • CFBundleTypeExtensions - Extensions for this file type
  • CFBundleTypeOSTypes - OSTypes for this file type
  • CFBundleTypeIconFile - Resource ID for the icon for this file type
  • CFBundleTypeName - User visible name for this file type, i.e., the kind string used by the Finder and others.
  • CFBundleTypeRole - Role of the application for this file type (Editor/Viewer)
  • LSTypeIsPackage - This document type is a package, whether defined by a CFBundleOSType or CFBundleFileExtension
The key descriptions above are from this Apple TechNote.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[12,269 views]  

Assign custom default icons | 1 comments | Create New Account
Click here to return to the 'Assign custom default icons' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Assign custom default icons
Authored by: perihelion on Jun 28, '05 06:57:11AM

This was exactly what I was looking for, and the explanation seems to work fabulously, however, I have applied the hint and still it does not work.
Yes, I've tried to restart, yes I copied&pasted both the icon name and the string name (while editing plist, so no typos), yes I've tried the (3d party) finder icon -> clear "command".
When I get info on a .doc file, and switch to word, the icon switches accordingly, then when I switch to textEdit, the icon also changes accordingly, but when I click "apply all" the icon switches back to "empty" (as it does on boot).
I have successfully replaced already defined icons, but not managed to add new ones.

Any ideas? I guess I'll have to try some other stuff in some way.

---
Information is the echo of the soul.



[ Reply to This | # ]