Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Easily copy all versions and sizes of a file's icon Desktop
Here's an easy way to create a copy of all sizes of a file's icon from the Finder:
  1. Select the file whose icon you want to copy.
  2. Copy it (using the Edit menu, Command-C, or the contextual menu).
There's no need to open a Get Info window first; just copy the selected file. You can then put this into a .icns file using Preview's File -> New from Clipboard command (Command-N). This method includes all sizes and alpha channels -- you get everything. And from there, you can save as TIFF or PNG or any other format.

Saving to TIFF will keep all the images (TIFF supports multiple images per file, and Preview takes advantage of this). When you save to any other format, such as PNG, you can choose any of the representations in the drawer. Whichever one is selected is the one that will be saved.
    •    
  • Currently 2.40 / 5
  You rated: 3 / 5 (5 votes cast)
 
[9,744 views]  

Easily copy all versions and sizes of a file's icon | 7 comments | Create New Account
Click here to return to the 'Easily copy all versions and sizes of a file's icon' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Awesome tip, dude...
Authored by: fishtech on Aug 08, '06 07:52:15AM

Wish I'd had this one last week when I was creating training docs for in-house apps.
Thanks,
ft.



[ Reply to This | # ]
Resulting tiff is flat
Authored by: leisuremonkey on Aug 08, '06 10:16:20AM

Unfortunately, the resulting tiff file is flat when opened in photoshop. You only get the largest size, and there's some distortion.



[ Reply to This | # ]
Resulting tiff is flat
Authored by: boredzo on Aug 11, '06 04:38:13PM

You can get around that by saving the whole TIFF once, then saving each size from Preview. It's a hassle to do everything over for each size, but it works.



[ Reply to This | # ]
Easily copy all versions and sizes of a file's icon
Authored by: coolsoldier on Aug 08, '06 10:26:50AM

Two things:

1. This doesn't work for documents that preview is capable of opening.

2. I don't see any way to save the result as an .icns file.

Otherwise, it seems to work.



[ Reply to This | # ]
Easily copy all versions and sizes of a file's icon
Authored by: Lankhmart on Aug 08, '06 11:42:19AM
You can copy to the clipboard just as the hint says, then run this script to save as an icns file:

try
	set icns to the clipboard as «class icns»
on error err number -1700
	display alert "Please select an item in the Finder and copy to the clipboard before running this script." as warning buttons {"OK"} default button 1
	return
end try

set desk to (path to desktop)
set icns_file to choose file name with prompt "Save icon:" default name "untitled.icns" default location desk

set file_ref to open for access icns_file with write permission
try
	set eof file_ref to 0
	write icns to file_ref
	close access file_ref
on error err number num
	close access file_ref
	display dialog ("Error writing file: " & err & " (" & num & ")") buttons {"OK"} default button 1
	return
end try
tell application "Finder"
	set creator type of icns_file to "prvw"
	set file type of icns_file to "icns"
end tell


[ Reply to This | # ]
Easily copy all versions and sizes of a file's icon
Authored by: chyna4xena on Aug 15, '06 05:03:39AM

Wow, that is great, thanks!

I am running 10.3, and I had to remove the 'as warning' section from the 'display alert' line before it would compile.

Now it seems to work (generates icns files with three icons that open in Preview), except that a 'stack overflow' error is generated by the Finder commands that attempt to change the creator and file type.



[ Reply to This | # ]
Easily copy all versions and sizes of a file's icon
Authored by: chjabu on Aug 08, '06 03:29:15PM

The .png file keeps the icon's transparency as well.

---
----
New Mac?
Basics4Mac.com
Your Personal Mac Guide - Tips and Live Help for new Mac users and Switchers



[ Reply to This | # ]