Any hardcore OS X Mavericks guys know how default folder icons work?

Posted:
in macOS edited March 2014

Hi guys, first time poster here.

 

I have a question that's just been bugging me for months now and I can't figure it out.  I just want to know HOW something works.  I've poked around some .plist files and have gotten somewhere, but still can't figure it out.  It's regarding Document OS Types and default folder icon associations.

 

Here's the deal.

 

When you install Mavericks cleanly, the system automatically creates about 9 folders or so inside of your home folder: Applications, Documents, Downloads, Movies, Music, Pictures, Desktop, Library (hidden by default), Public.

 

All of these folders get their own custom icon by default.  They also get a custom Sidebar icon (except for Public, Library).

 

I wanted to create a 'Games' folder and make it look as though it was put their by the system with it's own custom icon, and by putting it into the Sidebar, get it to have its own custom icon over there too.

 

I've noticed that if you create a 'Sites' folder inside of your home folder, it gets a custom icon by default.  If you create a 'Sites' folder outside of your home folder, it gets the generic folder icon by default.  By looking into the Info.plist file that's located in

/System/Library/CoreServices/CoreTypes.bundle/Contents

you can see that certain Document OS Types get certain icons by default.  (The Sites folder that is inside your home folder, however, does not get a custom Sidebar icon, it gets the generic folder icon.)

 

So, since creating a 'Sites' folder in a specific location only (inside of the home folder) gets a special icon, I know that Document OS Types are defined by path discrimination.  Somewhere, there must be a file that says 'Path X gets Document OS Type Y' and then in that Info.plist file, you define 'Document OS Type Y gets sidebar icon Z and Document OS Type F gets folder icon G'

 

*Please note that I do know that right-clicking a folder, then clicking 'Get Info' will bring up a dialog with which I can paste a picture over the icon to set a custom icon, but that's not how the system is giving these special folders default icons using .icns files.  (You'll notice that when you do that pasting method, the 'size on disk' changes for your folder.)*

 

I am curious to know how these default icons work and where the file is located that connects a path to a Document OS Type.

 

Any help would be appreciated, thanks.

Comments

  • Reply 1 of 1
    MarvinMarvin Posts: 15,310moderator
    They seem to be handled by /System/Library/CoreServices/CoreTypes.bundle and the info.plist in that bundle (right-click show package contents), icons are in the resources folder.
Sign In or Register to comment.