0

I am developing an application in which I have to mark a set of files/folder. The marked files/folder when viewed in Finder must be shown with a custom icon. But when they are selected for preview ( using spacebar) they must show their original icon ( i.e the blue icon for folder etc) .

This behavior is similar to symbolic links in the fact that for symbolic links , an arrow comes at the lower left corner of the icon whereas when we preview it , it shows the icon of the file/folder it is pointing to (without the arrow) .

Now I went over [[NSWorkspace sharedWorkspace] setIcon:icon forFile:@"path" options:NSExcludeQuickDrawElementsIconCreationOption];

But it sets the icon of the path permanently and the same custom icon appears when I preview it .

I tried to register a custom file type but the same problem happened . The custom icon also appeared in the preview.

Can anyone please help me out ?? Thanks :)

ping localhost
  • 479
  • 3
  • 22

2 Answers2

0

Symbolic links are not just documents, but a special entity in the OS, and therefor gets special treatments in some cases.

If you use setIcon:forFile: to set an icon, I do not believe there are any options to say that the icon should only appear in directory view, and not in preview.

Nils Munch
  • 8,805
  • 11
  • 51
  • 103
  • Munich is it possible to customize the behavior of finder by way of some extension ? I read about the scp pluggin that was used to create overlays on icon . – ping localhost Oct 26 '11 at 07:13
0

Starting with OS X 10.6, you will need to inject code into the Finder process and override objective C methods in the Finder process. Refer How to Write OS X Finder plugin post.

Community
  • 1
  • 1
Parag Bafna
  • 22,812
  • 8
  • 71
  • 144