Is there a way to manipulate icons on an Mac OS X file from either Automator or the terminal?
In my case, I want to remove custom icons (that is, the same as doing 'Get Info' and Edit->Cut on the icon) from a large number of files.
|
Is there a way to manipulate icons on an Mac OS X file from either Automator or the terminal? In my case, I want to remove custom icons (that is, the same as doing 'Get Info' and Edit->Cut on the icon) from a large number of files.
| ||||
feedback
|
|
I asked this question back in 2007. A combination of 3 OS X tools can do this. You need Developer Tools installed, then check out: /Developer/Tools/Rez, DeRez, and SetFile. You can use 'sips' to give an image file a custom icon of itself ('sips' acts on the original file so it might be safer to work on a copy):
If you just wanted to give an image file a thumbnail custom icon of itself, you can stop there. Otherwise, if you have the "Developer" / "X Code" tools installed, you can use 'DeRez' and 'Rez' to manipulate the resources to copy the newly created 'icns' resource to a file:
Then copy the the temp file into the icns resource of the recipient file, and set the custom icon file attribute:
Finally, restart the "Finder" to view the changes:
Original question and answer thread: http://forums.macosxhints.com/showpost.php?p=372418&postcount=7 | ||||
|
feedback
|
|
I am not sure about Automator, but it's possible from Cocoa using
or as a simple Python script:
| ||||
|
feedback
|
|
For more options:
You can check if the file has associated | ||||
|
feedback
|