How can I make the icon of a folder to be a given .icns file?

Solution 1:

  1. "Get Info" of the folder you want the icon to be replaced,
  2. using Finder, drag and drop the *.icns file to the current top, i.e. smaller icon of the folder in the "Get Info" window.

example

Solution 2:

Open the .png file in Preview (or convert image to png) or open .icns in Preview

Press command+A to select the entire image

Press command+C to copy the selection

Control+Click on the file/folder you would like to change and "Get information"

Click the icon (so there is a blue frame around it)

Press command+V to paste the image into that.

*Sometimes you can go straight from the Get Info window of the .icns and copy the image icon there into the Get Info of the item you want to change. This works for most Apps except Finder.

Solution 3:

I had this problem myself and the only solution I found was to use Cocoa: [[NSWorkspace sharedWorkspace] setIcon:image forFile:filePath options:0];

I've written a simple app that just asks for an icon, then a file or folder on which to apply that icon. You can download it here: http://d.pr/f/2qRK/1k0UHTJ6