granth green sumo

turkey sandwiches!

:point_up: nuh-uh-uh He was way more interested in the bucket than the turtle. :sun_with_face::umbrella:️:rainbow: Photo Photo :thumbsup::hamburger: Beets of the Southern Wild

Set an Icon With Rubycocoa 16 May 2008

os10, ruby, rubycocoa

I couldn’t find a built-in command-line program to set an icon for a file in OS X. Here’s a RubyCocoa script to do the job:

require 'osx/cocoa'
img = OSX::NSImage.alloc.initByReferencingFile("some.icns")
OSX::NSWorkspace.sharedWorkspace.setIcon_forFile_options(img, "foo.txt", 0)

previously: Wasting Valuable Pixels