Saturday, November 25, 2006

The Ultimate OS X Icon Changing Guide

Since buying my MacBook Pro early in 2006, I've been looking for a good guide to changing icons in OS X - one that would change any, and every icon on my computer. One that was understandable and reliable. One that worked for free. Every site I turned to seemed to address one (count 'em, one) facet of the issue. However, no singular site told me, hands-down, how to customize my Mac to its fullest extent.

If you've been Googling like I have, you've long since grown tired of the words, "Try Candybar!" and "What's so important about changing your Finder icon, anyway?" Look: I'm a PowerUser, freund. I'm not paying $12 (quite reasonable, but still!) to own a program that, at best, replaces a few keystrokes. Frankly, when I tried CandyBar, it failed to change certain 'persistent' icons, like the Finder and Trash (I know it works, but for whatever reason, it's never done so - flawlessly, anyway - for me). As for the "Why?" issue: Because, goddamnit, there's no reason that I shouldn't be able to do whatever the f'ck I want to my computer.
Note: this Guide (yes, I capitalize it - it's that good) attempts to move in ascending difficulty from the easiest, most generic methods to the most difficult, involved methods of icon replacement. If you've tried all the other sites and nothing's worked - e.g. you're trying to replace default system icons (Finder, Trash, System Preferences) or mime icon types - you'll want to skip ahead. It wouldn't be an Ultimate Guide if I didn't include the basics.

At the lower levels, you'll be able to do absolutely no damage to your system - by the third step, when you're replacing System icons, you could bring your Mac to its knees. Never work beyond your understanding, but
do have some fun!

Well, after almost an entire year of off-and-on browsing, after trial and error with countless freeware and demo programs, I can now change every single icon on my Mac. For free. Being such a beneficiary to my fellow man, I decided to write this guide for all of you:

The Ultimate (Free) OS X Icon Changing Guide: How to Change Every Single Icon on Your Mac.

Before we begin, here're a few sites to get you started; they've got some great free icons, wallpapers, and screensavers. Perhaps more importantly, they've got additional information on creating icons yourself. The Mac community is wonderfully open with its creative elements - but that's no reason that you shouldn't give it a whirl yourself!
InterfaceLift - beautiful icons and gorgeous wallpapers.

Mandolux - one guy's personal site, with a great collection of high-resolution and multi-monitor wallpapers.

Apple's OS X Downloads - some great screensavers and awesome icon sets.

WinCustomize - great icons. They're mostly oriented towards XP users, but many of the .png's are suitable for OS X.
Secondly, here are some programs that we'll be using in the Guide - if you already know what you're looking for, you might see exactly what you need and be able to skip the intervening bullhonky. Alternately, if you're going to complete the tutorial to the end, you'll need to grab these anyway. Sites with small apps like this tend to go in and out frequently, so I've taken the liberty of making some MediaFire mirrors to keep things moving.

Icon2icns: creates .icns files from normal icons. mirror
Pic2Icon: creates icons from any picture; adds resource forks to improperly prepared icons or .icns files. mirror
Finally, if you're looking to turn an .icns into a .png, you can use sips as detailed here.
Alright. If you're ready, god knows I am. If you need any help, have any suggestions or comments, etc., email me at brandon101 at mail dot com.
Section 1: Changing Basic Icons: The Copy'n'Paste Method
This covers the normal method for changing individual icons in your Home folder or subfolders, basic applications, and some higher-level folders like Users and Library.

Section 2: Changing Persistent Application Icons: The .icns Method
This addresses changing those pesky icons that just refuse to submit to copy'n'paste. Includes Mail, System Preferences, some 3rd-party apps, etc.

Section 3: Changing System Icons: The sudo Method
This section addresses everything else: the Finder, the System and Applications folders, Disk Images, filetype icons - you name it.
Alright, enough talk. Let's get to it!

Changing Basic Icons: The Copy'n'Paste Method

This is where it all starts. You've downloaded a set of icons, and you're eager to get rid of those ugly default folder and application icons. Well, that's easy enough.

Also, if you've already tried the copy'n'paste method on a particular icon and it seems to work but constantly changes back to the original, you'll need to see the next step in the Guide: Changing Persistent Application Icons.


Copy'n'Paste
For most of the icons in Mac OS X (those that you'll see on a daily basis, anyway), the Copy'n'Paste method will suffice. It involves no use of the Terminal or sudo commands, can't possibly screw anything up in a permanent sense, and has only two steps: the aforementioned 'copy' and the subsequent 'paste.'

This will work on anything in your Home folder or subfolders (this includes your Library, Desktop, Documents, Movies, Public, Music, Pictures, and Sites folders), your individual files, most Application icons (as well as the way these show up in the Dock or on the desktop), and several of the 'Macintosh HD' icons like the User, Library, and Applications folders.

Note: if you're having any trouble so far, or don't understand what I mean by the 'Home' folder or its contents, check out this site, which will explain the basics of the OS X folder hierarchy.

Let's Get It On
Alright, I'm assuming that you've already downloaded an icon or set of icons, or you wouldn't be here. Well, maybe you would, but it'd be a very preemptive move on your part. Overachiever, are we? Anyway, if you haven't found some cool icons yet, try InterfaceLift, Apple's Download Site, or IconFactory. Go ahead and save your downloaded icons to a folder or series of folders in your home directory, so that they're accessible.

Now comes the easy/hard/only part. Without going into too much detail, icons which are OS X-ready have two components - the icon file itself (usually a .png or 'Mac OS Icon' format, which has no extension) and an applicable 'layer' called a resource fork which allows it to be pasted over other icons - think of it, in this case, as visual metadata. Icons which aren't properly prepared will give you various problems, which I'll address shortly. Unless you care enough to Google it, you needn't really worry about how these work.
The File Types:
When downloading, you'll usually encounter 3 icon types:
.png's, which may or may not include both metadata-style resource forks,
.icns files, which usually don't include both resource forks, but are meant to replace persistent application icons,
and 'Mac OS Icon Files, which have both resource forks and are perfect for the copy'n'paste technique.
Changing Yer Average Icon
Here we go. Find the new icon that you want to apply to, say, iTunes, and select it with the mouse or keyboard. Then (are you ready for this?)...hit Command+C to copy it.

Whew.

Now we're ready to paste. Go to your Applications folder, select the iTunes application, and hit Command+i to bring up its Get Info menu.


See that icon at the top left of the iTunes Info window? Select it with your mouse (a faint blue outline will appear around it - it may be hard to spot at first). Once it's selected, press Command+V to paste the new icon over the old. If nothing happens, you may need to press it an extra time or two - it's finicky sometimes.

For most icons, that'll do it! There are only a couple of situations in which this might not work, and I'll address those now. Whichever problem you're facing, there's a solution:

The Damned Icon Keeps Changing Back!
This is what I'm calling a persistent application icon, and is addressed in the next part of the guide. You'll find this to be the case with Mail, System Preferences, other Apple apps and even some 3rd-party programs like the ineffable newsreader Vienna. This is also the case with the Applications folder in the Finder's sidebar, which is addressed in the final section on Changing System Icons.

Nothing Will Happen At All!
If you try and try to copy'n'paste a particular folder or application icon and it refuses to change at all (the top-level System folder is a good example of this), this is because you don't have the necessary privileges to change its resource fork. For situation like this, you'll need to gather your inner fortitude and jump to this Guide's 3rd section which, again, discusses Changing System Icons.

I Did Everything Right, But It Shows a Blank 'PNG' or 'ICNS' Document!
This is where the aforementioned resource forks come into play. Sometimes, icons which are incorrectly prepared (or are in .icns format because they're meant to replace persistent application icons) lack the copyable metadata information that the copy'n'paste method uses to replace icons. Luckily, there's a great (and free!) fix for this! It's called Pic2Icon, and you'll love it from the first time you use it!

To use Pic2Icon, you'll simply start the program and drag your .png or .icns icons into the drop box (in my picture, it's got a 'recycle' symbol - that's custom, so you'll see something a little different) and release! Pic2Icon will process your file(s), adding the necessary resource forks automatically.


Nothing will appear to change, but if you choose a processed file and open its Get Info window, you'll see the correct icon at the top left. This means that it's ready for the copy'n'paste method!

Now that was easy enough, but suppose you want...more? Suppose you refuse to put up with those pesky persistent icons, or want to change Finder's? Well then it's time for the next step (which will in turn prepare you for the 3rd section): Changing Persistent Application Icons.

Changing Persistent Application Icons: The .icns Method

Note: this only applies to apps found in the Applications folder itself - other Apple applications like Finder and items like the Trash require changing icons within OS X's core system, and are addressed in the third tutorial.

Unfortunately, the copy'n'paste method, as easy as it is, just will not work on everything. Certain applications, including some of the Apple apps like Mail or System Preferences will 'change back' at what seem to be completely random times. "WTF?" you ask, since you're not a particularly eloquent sum'bitch.

Well, what's happening is this: some applications come with an icon file inside the .app package itself, and automatically call that icon back when another application (like the Dock or the Finder) attempts to display them. Now, if you call up the application's Get Info window in the Finder, you'll probably still see your pasted icon - it simply won't display. In point of fact, it may even come back after a while (this is particularly common, in my experience, with the Application folder itself). But that's simply not good enough, right? So how do we resolve this issue?

These are what I call persistent icons, and this tendency is generally limited to Applications (and the Application folder itself - though permanently changing its look requires us to work with System files, and so won't be discussed until the third and final section). Without going too deeply into exceptions or particular applications, it's enough to know that if an icon changes back the the original without prompting on your part it's being persistent, and its icon can be permanently changed as follows:

Finding the Original .icns File
As aforementioned, when these applications attempt to display themselves in the Dock or Finder, they'll call on their interior icon file - one that ends with the suffix .icns. We'll begin by opening the .app package and locating this persistent icon. For these purposes, we'll change Apple's Mail icon.

In the Finder, navigate to your Applications folder (it may be listed in your sidebar - or you can alternately press CMD+Shift+A to go directly there). Find the program whose icon you're looking to change, Control-Click on it to bring up its contextual menu, and click on the Show Package Contents item. If this sounds bizarre to you, check out this link to learn more about application packages in OS X.



After opening the package, open the folder Contents and its subfolder Resources. In here are (normally) stored all associated icons, splashscreens, and other visual components of the software. All of these can, conceivably, be changed by the user, but we're here to hunt down the icon itself. Within this Resources folder you should see the application's default icon - a file with the extension .icns. It may be named just about anything, but it should be plainly obvious what we're after here. In Mail's case, it's app.icns.

Preparing The New Icon
Note: if you've downloaded a set of icons for a program like Mail, which is well-known for requiring .icns formatted icons, said icons may already be in .icns format. In such cases, you can skip this step.

Now that we've located the persistent icon, we can prepare to replace it with one of our own. For this, we'll need to convert our downloaded icon (which is normally in .png form, but could also be in any of several other OS X-specific formats) to an .icns file (products like the much-touted CandyBar may negate the need for this step - but the whole point is to do this for free, right?). To do this, we'll be using Icon2icns. Download, install, and run the program. When Icon2icns appears in the Dock (all you'll see is the icon - there's no GUI to speak of), we're ready to make an .icns icon.

Find the new .png icon that you wish to use for the program, and drag-n-drop it onto the Icon2icns program in the Dock. Magically (no, really!), a new file will appear in the same folder (or on the desktop; wherever you dragged from) - it's your icon, but all of a sudden it's being trailed by an .icns extension! Now we're ready to backup the application's old icon and replace it with the new one.

Replacing the Icon
Because we're responsible users and something could, conceivably, go wrong, we'll backup the old .icns file. Since administrative users (I'm assuming this is you - if it's not your computer, you shouldn't be messing with this stuff!) have read & write access to all .apps, we should be able to simply click on the original .icns icon and press the enter key to rename.

For several reasons involving ease of use, just append 'Backup' to the file name and press enter to apply the change. Hence, 'app.icns' would become 'appBackup.icns.' Now not only do you know what file the application looks for (after all, the new icon must be named exactly that!), but you can also easily locate and rename the icon from the command line if you ever need to restore to the original (while changes like these should have no chance of impacting system stability, it's always better to be safe than sorry).

Finally, we'll change the name of our new icon to match that or the original ('app.icns,' in this case) and drop it in the Resources folder as a replacement (in that order or vice-versa - as long as you do both, it doesn't matter which comes first). It should show up right next to the backup (another good thing about this naming scheme).


Results
...And that's that! Not so bad, huh? You may want to log off or restart the computer (certainly the application itself!) to see the changes. With persistent icons like these, you shouldn't need to change that .app icon again (as seen with the copy'n'paste method) - it should change for you when the new .icns is loaded (prompted, again, by a restart or login).

Even so, nothing's foolproof. If you've restarted and the .app icon still isn't right in the Finder or Dock, you may want to use the copy'n'paste method as well. Furthermore, it may help to drag the application out of the Dock, and then back in from your Applications folder.

Finally, there's a chance that you still won't see the new icon in the Dock, due to the Dock's icon cache. This is usually resolved after a reboot, but alternately you can navigate to /Library/Caches and delete any file starting with com.apple.dock.iconcache, then log out and back in. This will ensure that the Dock rebuilds its cache and pulls up the new .icns file to display! Huzzah!

If you're ready for the Bigtime check out the next section, where we'll be changing:
The Finder Icon
The Trash Icons
Generic Folders
System Folders
& That Pesky-Ass Applications Folder Icon That Always Changes Back in the Sidebar!
See ya there!

Changing System Icons

Note: replacing System-level icons is a whole new facet of the game. From here on in we'll be working with the command line in Terminal and using administrative (superuser) access to make changes that will affect the whole OS. I'll do my best to make everything super-clear (i.e. you won't actually have to know what you're doing), but I suggest that users new to a Unix-style command-line read over some basic concepts, courtesy of the...well, I was going to direct you to the awesome Linux Cookbook, but it appears that it's no longer available online. So here's some Wikipedia reading on the commands and concepts that we'll be using: *nix, cd, cp, mv, ls, root, sudo, and su. It's also important that you understand why OS X protects these files from you by default - screwing up at this level could potentially destabilize your entire system. In the end, if you don't have at least some history with Linux or Unix commands, be very very careful, don't do anything that you don't understand, and make the backups that I recommend.

Since we'll have backups (assuming that you follow these directions to a tee), there's no real danger as long as you understand how to use the commands listed above. At the end of the article, I'll address what to do if something
does go terribly wrong - but let's try to avoid that kind of disaster with careful forethought, shall we?

I take absolutely, positively no responsibility for mistakes you make while executing these maneuvers. I'm warning you now - if all of this looks like complete Greek to you, consider whether personalizing your Finder icon is really worth the risk of screwing up your expensive-ass Mac. None of these mistakes are at all permanent, but they might as well be if you don't know how to fix them. CandyBar is a very reasonable $13 - much cheaper than a repair job.

On To The Good Stuff
So you've got your regular applications looking like you want, you've customized the default .icns files for Mail and other persistent icon applications, but you're lusting for more. What about the Finder and the Holy Grail of OS X icon schemes: the Trash? Is it possible to do this for free, and without too many added headaches? But of course. However, it does require a little more finagling on your part, as well as root access. If you're not the owner of the computer you're modifying, it absolutely will be irresponsible and - perhaps even literally impossible - to continue.

First off, we'll need to give ourselves root access. Sure, you're the computer's administrator already (right?), but to prevent damage to the core system, OS X comes with superuser mode disabled. We'll need to set a root password so that we can use su properly.

Setting The root Password
I hate to sound like a broken record, but I'll say it one more time: if you don't own this particular computer, do NOT proceed. Also, root access is disabled for a good reason. Don't ever use root to make changes to the system if you don't have to.

First, we'll need to open a Terminal window. If you're unfamiliar with Apple's Terminal application, suffice to say that it's OS X's take on a Unix command line, and is set by default to the Bash shell. It can be found in your Applications/Utilities folder, or you could launch it by searching for 'Terminal' in Spotlight.

Once we're in Terminal, we're ready to enable OS X's (well, Darwin's) superuser mode. To do this, we tell it to set a new password for the root user. (If you don't realize how important it is to do this right, don't do it. There are a thousand ways you could mess things up if you're uninformed.) At the prompt, type sudo passwd root. You will be prompted for said password, and asked to confirm. There ya go.

Now, before we continue, I'll make some concessions to the Linux powers-that-be. I'm not going to lecture you on your newfound power, but know this: running as root in *nix systems is asking for trouble. In our case, we'll be using su, a command which temporarily gives us root authority while we change our icons. Even better would be sudo, but since we'll be making several changes in a row and maybe doing a little navigation, I'm going to go out on a limb and go su rather than just chaining several commands together. I feel that this will make the different steps more clear to the reader.

Unfortunately, there isn't much method to the madness, so changing the Trash icon will be somewhat different from changing Finder's. However, it's all variation on a theme: we find the icon we wish to replace, we prep the new icon (to ensure that it's in the same format as the original), backup the old, and shuttle in the new. This will be about 50%-50% Terminal-GUI work.

Prepping The New Icon
Well, since we don't want to run as the superuser any longer than necessary, let's go ahead and get everything ready for the switch. First, we need to find the icons we're looking to replace. Here are the locations of the some major elements:
Note: anything which refers to the CoreTypes.bundle can be found under /System/Library/CoreServices/CoreTypes.bundle.

Finder: /System/Library/CoreServices/Finder.app/Contents/Resources/Finder.icns
System Folder: /CoreTypes.bundle/Contents/Resources/SystemFolderIcon.icns
Generic Folder: /CoreTypes.bundle/Contents/Resources/GenericFolderIcon.icns
Smart Folder: /CoreTypes.bundle/Contents/Resources/SmartFolderIcon.icns
Trash: /System/Library/CoreServices/Dock.app/Contents/Resources/trashempty.png
Full Trash: /System/Library/CoreServices/Dock.app/Contents/Resources/trashfull.png


Now, you'll note a couple of things here - at least I assume you will. Primarily, you'll note that these are deep, system-level icons; if you change any of these, they will change for every user. Having different users with different themes are where commercial products like CandyBar come in.

Secondly, you'll see that different filetypes are involved. The Trash, specifically, requires a .png filetype, while the rest require .icns files. Often, downloaded icon sets will be in one or the other of these formats; sometimes, however, they may be of an OS X-specific filetype (if there's no extension after the filename, this is probably the case). Click on the desired icon and press Command+i to open its Get Info panel. At the top, the Kind will be listed.

So now that we've found our original icon and know what we want to replace it with, we need to convert the replacement icon to match the format of the original (if it already does, you can obviously skip this).
To convert 'Mac OS Icon File' or a .png to .icns: Download, install, and fire up Icon2icns. Drag the desired icon from its folder to the Icon2icns icon in the dock and drop it in. A converted .icns file will appear in the same folder as the original.

To convert 'Mac OS Icon File' to .png: Follow the steps above. Then open a Terminal window. We'll use the sips command to make the conversion like this:
sips -s format png /Path/To/Icon.icns --out /Path/To/ConvertedImage.png
(This technique comes directly from an MacOSXHints article by ChaChi.)
Alright, now that our icon's of the right format, we're ready to backup and replace. We'll use Finder as an example for this.

Replacing the Finder Icon
This is where one needs to be very careful. As a superuser, you have the power to negatively affect your system if you press buttons without thinking. Please follow the directions carefully.
First we'll gain the superuser privileges needed for our work by typing su and entering the password we set earlier.

Secondly, we'll open a Terminal window and navigate to the directory containing the icon:
cd /System/Library/CoreServices/Finder.app/Contents/Resources

Then we'll back up our original Finder icon, using the mv command to move/rename it:
mv Finder.icns FinderBackup.icns

Then we'll move our new icon, already in .icns format, to replace the old icon - and rename it along the way:
mv /Users/myname/IconLocation/New.icns ./Finder.icns

Lastly, we'll exit superuser mode to prevent accidental damage:
exit
If you navigate to the location using the regular Finder window, you should be able to see the new icon and the backup sitting next to one another. Kudos!
Now let's reboot and give the new icons a chance to take effect! If you've rebooted and still don't see the correct icon in the Dock (e.g. Finder), use Finder to navigate to /Library/Caches and delete any files that begin with com.apple.dock.iconcache, then log out and back in. This will cause the Dock to rebuild its cache, and your new Finder/Trash/System Preferences icons will show up for sure!

Finally, let's open the Disk Utility application (Applications/Disk Utility), click on the hard drive containing our OS X installation, and tell it to repair our permissions. This likely unnecessary step will nonetheless make sure everything's truly squared away.

So What If...?
So what if you screwed up? What if you screwed up bad? What if OS X isn't starting (this is unlikely), or your icons don't look right? Well, we made backups, remember? Let's change Finder back.
If you can get into OS X, but something's wrong with the icons:
Open a Terminal window, type in su and your password, and navigate to the location of the Finder.icns and FinderBackup.icns:
su
cd /System/Library/CoreServices/Finder.app/Contents/Resources

Then restore the backup (this will overwrite the one you placed in there, without asking):
mv FinderBackup.icns Finder.icns


If you can't get into OS X:
Power the computer off.

Start the computer in Single-User mode by pressing the power button, then pressing and holding Command+s when the startup sound is made. Eventually you'll be dumped at a *nix prompt.

Either log in as root with your new password, or log in with your normal username and password, then use su to gain superuser privileges. Navigate to the proper folder:
cd /System/Library/CoreServices/Finder.app/Contents/Resources

Then restore the backup (this will overwrite the one you placed in there, without asking):
mv FinderBackup.icns Finder.icns
Whichever method you've chosen, you can now reboot (shutdown -r now in single-user mode) and you'll be back where you started! Assuming you made backups, this is no big deal!

A Caveat: File Extension Icons
There are, of course, standard icons for both known and unknown filetypes. These are the blank 'ICNS,' 'PNG,' and other files that Finder can't (or has been set not to) preview.
Every extension is associated with some icon or another, depending on whether or not a 3rd-party app has 'adopted' the filetype. This icon type can be found in one of two places:
The 'Parent' application's .app package
or
The 'Preview.app' package, which contains default icons like the one above.
These are .icns icons and will need to be backed up and replaced in the same method as most of the system icons above.

Another Caveat: The Default Disk Image Icon
This one took a little doing, mostly because I was using the find command incorrectly for a while (so sue me; it's been a while). However, as long as I'm here, I figured I'd run down my logic for those unfamiliar with a *nix environment, in the hopes that you'll be able to find 'lost' icons in the future.
cd / (This of course takes me to the root level, so that I'm searching the whole system at once)
find . -name *disk*.icns
To anyone unfamiliar with the logic here, I simply told find to look in the directory (in this case, the whole disk) for an .icns file with the word "disk" somewhere in its title. Depending on what 3rd party software you have installed, you'll see the paths to several files listed. Any guess as to which one it might be?
17:15:24: /Users ->cd /
17:15:27: / ->find . -name *disk*.icns
./Applications/Docktop.app/Contents/Resources/idisk.icns
./Applications/JDiskReport.app/Contents/Resources/jdiskreport.icns
./System/Library/CoreServices/DiskImageMounter.app/Contents/Resources/diskcopy-doc.icns
./System/Library/CoreServices/DiskImageMounter.app/Contents/Resources/diskcopy.icns
./System/Library/Extensions/IOHDIXController.kext/Contents/Resources/diskimage.icns
./System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/Resources/DiskImages UI Agent.app/Contents/Resources/diskcopy.icns
./Volumes/Leopard Install/System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/Resources/DiskImages UI Agent.app/Contents/Resources/diskcopy.icns
17:16:42: / ->
Well, if you're like me, you immediately honed in on the IOHDIXController.kext, because it actually lists a 'diskimage.icns.' However, if you navigate to the folder in Finder, you'll quickly see that this isn't the file we're looking for. In the end, the default icon that appears whenever Finder sees a generic disk image file is the diskcopy-doc.icns lurking in the DiskImageMounter.app. From here, we'll prepare and replace just as we did with the Finder icon, making a backup as we go:
cd /System/Library/CoreServices/DiskImageMounter.app/Contents/Resources/
mv diskcopy-doc.icns diskcopy-docBackup.icns
mv /Users/myname/Desktop/prepared_icon.icns ./diskcopy-doc.icns
And there ya have it. By using some *nix suaveness and our established backup'n'copy method, we no longer have to look at that ugly default disk image icon!


The Application Folder Icon: The Last Caveat
Now this one's a little different. The Application Folder Icon is a special case, for a good reason (though it's annoying as hell to deal with). The question you're asking is, "Why is it that I can change the Application Folder Icon, but it always changes back in the sidebar?" Well here's the answer:

The Application Folder is, by default, available to all users. Otherwise, you couldn't access Camino or save your bookmarks when you browsed. Indeed, if you navigate to the hard drive level, you should see the Application Folder with the icon that you gave it. But it tends to change back in other parts of the Finder.

This is because there's another level, another resource fork, to the Application Folder Icon. It's a low-resolution default that's buried in the CoreTypes.bundle with so many other little pieces of OS X. Any user can change the way the they see the Application Folder, but when it's accessed by other parts of OS X (like the sidebar or 'Save' menus in Photoshop), it sometimes, but not always reverts to the default.

Luckily, there's no special magic to changing this default icon - it's just like changing the Generic Folder icon:

Prepare the new icon as described above.

Enter a Terminal session and enter superuser mode using su and the password you set.

Navigate to the directory:
cd /System/Library/CoreServices/CoreTypes.bundle/Content/Resources

Make a backup of the original file:
mv ToolbarAppsFolderIcon.icns ToolbarAppsFolderIconBackup.icns

Move & rename the new icon to replace the old:
mv /Users/myname/Desktop/PreparedIcon.icns ./ToolbarAppsFolderIcon.icns

You may find a few similar situations, which can be solved the same way, but the Applications Folder is by far the most noticeable.

That's it, freund. You can now change every icon, no matter how obscure, on your Mac. It's just a question of where it's located. If you have trouble rounding one up, try using the locate or find commands at the Terminal to search for it (these will search your whole computer, whereas Spotlight will not). Email me if you have too much difficulty - I'm not saying I can help, but I'll try.

Finally, if you have any questions, comments, suggestions, corrections, thanks, or short-cuts, feel free to comment on these pages or email me at brandon101 at mail dot com.