OSX Document Icons

How do you set a document icon for a standalone application in OSX with the Projucer? (A different icon from the Application Icon.) I’ve set the document extensions in the Projucer, and I cannot seem to figure out how to set an icon for a specific document extension. I have tried:

  • Creating an png named the same as the document extension. (added as an xcode resource)
  • Creating an iconset with the same name as the document extension. (added as an xcode resource)

Neither seem to work. Is there some magic I am missing?
Thanks!
Chris

2 Likes

+1, document icon could be different than the app icon

2 Likes

I don’t know if this is any help, but I think you should be able to achieve this by modifying Info.plist in the app bundle. The Projucer allows you to overwrite or add entries to the file by using the “Custom PList” field.

As far as I can tell you can use the key CFBundleTypeIconFile to refer to an icon file in your bundle. So I guess you would need to add the file as an Xcode resouce in Projucer.

These articles may be of use:

Another tip is to inspect the Info.plist file of some other application that does what you would like to do. For instance, you can get the XML from Xcode like this command: plutil -convert xml1 -o - /Applications/Xcode.app/Contents/Info.plist. You would probably be better off looking at a simpler app, but that’s what I could think of at the moment. :slight_smile:

This is a great idea! Thank you for taking the time to reply, it helps.

1 Like