On 18.07.2012, at 12:37, Alfian Busyro wrote:
> Just like I thought, injecting code is not a good way to do this.
> So, is it impossible to do this without injecting code to Finder ?

 For what purpose do you need this? If you only need a small number of 
animation steps, you could just set up a different filename suffix for each 
step, specify a different icon (all in your Info.plist) and then rename the 
file whenever you need the next step. Would that work in your case?

 In the old days, one could use Icon Services calls to change the icon used for 
a particular file type, that might even save you the renaming, but Icon 
Services is probably considered "old" API these days, and I'm not sure if 
changes to icons in your app using Icon Services will still affect Finder. 
Anyway, it's worth a try.

 Finally, you could use a custom icon (the kind you get when you click on the 
icon in a file's "Get Info" window in Finder and paste a graphic there). But of 
course, if there is any chance that your files already have a custom icon 
because the user set one on it, your code would replace that icon, which isn't 
nice. But for a newly-downloaded file, you could probably do that. I think 
there might be a setIcon:forFile: (or something like that) method in 
NSFileManager or NSWorkspace for setting a custom icon on a file.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://groups.yahoo.com/group/mac-gui-dev/




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to