Is there a way to change icon for a file kind?

Discussion in 'macOS' started by dodowolf, Apr 10, 2008.

  1. dodowolf macrumors newbie

    Joined:
    Mar 31, 2008
    #1
    I am using Chamonix to view the CHM files on my MBP, however, after I change the default viewer for CHM to Chamonix, all the icon for CHM has changed to a blank sheet (was using betterzip, so it was a wooden box with CHM on it), I searched for a while on the Internet, and there are only tutorials for change single files using the copy and paste icon file using "get info" command, and there is no conclusive instructions for changing the icon for a file kind, (.chm in this case)

    Does anyone have a solution?

    PS: I have tried to change the plist in the Chamonix, but so far no result..:(
     
  2. dodowolf thread starter macrumors newbie

    Joined:
    Mar 31, 2008
    #2
    Okay... I find something online..

    From: http://discussions.apple.com/thread.jspa?messageID=6909412

    I managed to get the icons displayed! Even though it's a dirty hack ;).

    That's what I did:
    (Since I like TextWrangler fine and it has the same shortcomings as jEdit, e.g. not displaying a symbol when I assign it to a sql file, I'll explain it on TextWrangler)

    0. open Terminal.app and go to /Applications/TextWrangler/Contents/
    1. do a vim Info.plist
    2. add the folowing dict as a child of "<key>CFBundleDocumentTypes</key>":

    <dict>
    <key>CFBundleTypeExtensions</key>
    <array>
    <string>sql</string>
    </array>
    <key>CFBundleTypeIconFile</key>
    <string>TextWranglerTextDoc.icns</string>
    <key>CFBundleTypeName</key>
    <string>SQL file</string>
    <key>CFBundleTypeOSTypes</key>
    <array>
    <string>****</string>
    </array>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    </dict>

    3. rebuild the Launch Services Database (OS X Tiger): /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frame
    works/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain system -domain local -domain user
    4. restart the Finder: killall Finder

    Done. For what reason ever the Finder won't accept a "*" instead of sql as stated here: http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/PListKeys.html

    If you want other suffixes than sql being recognized by TextWrangler just add more <string>xyz</string> to CFBundleTypeExtensions or create new dicts.

    However this remains a complicated act just for changing some icons ;).

    Hope it helps somebody.
     
  3. dodowolf thread starter macrumors newbie

    Joined:
    Mar 31, 2008
    #3
    Okay. It worked..

    With the exception that the lsregister file is located @
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
    for Leopard.
     

Share This Page