0

Using [[NSWorkspace sharedWorkspace] iconForFile:path] for an alias file returns an icon image with an arrow.

How can I instead get the icon without the arrow?

I don't want this arrow:

enter image description here

pkamb
  • 33,281
  • 23
  • 160
  • 191
stapoz
  • 1
  • 2
  • 2
    Just an idea: get the icon for the original file? – Willeke May 11 '19 at 11:18
  • This works but only if the alias has no custom icon. – stapoz May 12 '19 at 05:24
  • Can't you use the custom icon if the alias has a custom icon? – Willeke May 12 '19 at 10:16
  • How to get the custom icon of a file? NSURLCustomIconKey is not implemented in Cocoa ([url getResourceValue:&ret forKey:NSURLCustomIconKey error:nil] returns always nil). From the doc: "The custom icon assigned to the resource, if any (Currently not implemented, value type NSImage)" – stapoz May 12 '19 at 14:49
  • Why not to use the Quicklook preview image for the file as described in this post. https://stackoverflow.com/questions/8815458/get-quicklook-preview-image-for-file – Marc T. May 12 '19 at 17:00
  • See [Detecting if a custom file icon was set in Cocoa](https://stackoverflow.com/questions/16017927/detecting-if-a-custom-file-icon-was-set-in-cocoa) – Willeke May 12 '19 at 21:51

0 Answers0