2414 Views 3 Replies Latest reply: Dec 16, 2006 7:43 AM by MrGuilt
Welcome to the Apple Discussions.
Hmmm. I figured out a way, but it's kind of a long way around. It might be simpler just to buy Folder Icon X for $15 and be done with it.
I noticed the same thing you did: that the transparent pixels aren't transparent when you copy/paste from Preview. It appears that Preview doesn't copy the mask information (transparency). But, if you have a folder icon with transparency already, you can copy with the transparency. So here's what I did:
1. Create an icon in Photoshop. Save it as a TIFF with an alpha channel.
2. Use tiff2icns to change it to an icns file.
3. Use the Terminal to copy the icns file to the root level of a disk partition:
<pre class="command">cp ~/Desktop/test.icns /Volumes/VolumeName/.VolumeIcon.icns</pre>Note the filename, that's important: .VolumeIcon.icns.
4. This is where it gets kind of ugly. The Finder still doesn't realize the folder Icon has been changed, because you did it more or less behind its back, and the custom icon bit doesn't get set. If you have the Developer Tools (Xcode) installed, you have a couple of utilities in /Developer/Tools/ to look at files. You don't need them for this step but you do for the final one. To verify that the bit is not set, run GetFileInfo on the volume:
<pre class="command">/Developer/Tools/GetFileInfo /Volumes/VolumeName</pre>You'll get back something like this:
<pre class="command">directory: "/Volumes/VolumeName"
created: 11/07/2006 04:58:24
modified: 12/15/2006 22:56:37</pre>It's the "c" in there. man GetFileInfo will cough up the goods on those attributes.
5. For this step, you have to have Xcode tools installed. You reset the custom icon bit on your volume:
<pre class="command">/Developer/Tools/SetFile -a C /Volumes/VolumeName</pre>Once you click on the volume the Finder will refresh and show you your new Volume icon in all its masked, semi-transparent glory.
6. Now do your usual "Get Info" window dance, copying the icon from the disk partition's "Get Info" window to your folder's. Presto change-o, you have the same icon on our folder, because the Finder apparently does copy all the mask information...
The easy way is to download icns2icon:
Drop your icns file on it and it creates a regular custom icon for the file, which can be copied and pasted in the normal way from the GetInfo window of the file.