tumble. phil adams.

  • Archive
  • RSS

cli to apply a custom .icns icon to any file

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):

cp imagefile.jpg donorfile.jpg; sips -i donorfile.jpg

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:

/Developer/Tools/DeRez -only icns donorfile.jpg > tempicns.rsrc

Then copy the the temp file into the icns resource of the recipient file, and set the custom icon file attribute:

/Developer/Tools/Rez -append tempicns.rsrc -o recipientfile.xyz; /Developer/Tools/SetFile -a C recipientfile.xyz

Finally, restart the Finder to view the changes.

(via http://forums.macosxhints.com/showthread.php?p=372418#poststop)

  • 3 years ago
  • Permalink
  • Share
    Tweet
← Previous • Next →

About

<witty description />
  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr