2 * Simple tool for setting an icon on a file.
4 #import <Cocoa/Cocoa.h>
7 int main(int argc, char** argv)
10 fprintf(stderr, "Usage: seticon ICON TARGET");
14 NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
15 NSString* iconPath = [NSString stringWithUTF8String:argv[1]];
16 NSString* filePath = [NSString stringWithUTF8String:argv[2]];
18 [NSApplication sharedApplication];
20 [[NSWorkspace sharedWorkspace]
21 setIcon: [[NSImage alloc] initWithContentsOfFile: iconPath]