<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWorkspace/icon(forFiles:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWorkspace(im)iconForFiles:"
  },
  "title" : "icon(forFiles:)"
}
-->

# icon(forFiles:)

Returns an image containing the icon for the specified files.

```
func icon(forFiles fullPaths: [String]) -> NSImage?
```

## Parameters

`fullPaths`

An array of `NSString` objects, each of which contains the full path to a file.

## Return Value

The icon associated with the group of files.

## Discussion

If `fullPaths` specifies one file, that file’s icon is returned. If `fullPaths` specifies more than one file, an icon representing the multiple selection is returned.

You can safely call this method from any thread of your app.

## See Also

[`icon(forFileType:)`](/documentation/AppKit/NSWorkspace/icon(forFileType:))

Returns an image containing the icon for files of the specified type.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)