Until Mac OS 8.5, the Macintosh toolbox did not provide a good way to get the icon of a file or folder, as displayed by the Finder. One can use AppleScript to get an icon family, but the AppleScript Finder Guide doesn't seem to give enough information to do this from a language other than AppleScript. In any case, using AppleEvents to get icons from the Finder would probably be too slow for some applications.
Icons can come from various sources. The picture above shows several cases:
- an icon retrieved from the desktop database, using the file's type and creator codes
- a generic icon from the System, determined from the file type
- a generic icon from the Finder, determined from the file type
- an icon for a special folder (one of those found by FindFolder)
- a folder icon that indicates that the folder is shared or mounted
- a custom icon for a folder, coming from resources in an invisible file
- a volume icon, retrieved from the disk driver
Find_icon finds all these kind of icons, and attempts to find the same icon that would be displayed by the Finder. If the file or folder has a label color, that label color will be applied to the suite. Mini icons (12x16) are not supported.
Version 3.2 has been updated for compatibility with Carbon.
Version 3.2.1 has a few minor improvements, such as a fix for a bug in handling 32-bit icons when Icon Services is not available.