<!--
{
  "availability" : [
    "macOS: 10.8.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSFilePresenter/primaryPresentedItemURL",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(pl)NSFilePresenter(py)primaryPresentedItemURL"
  },
  "title" : "primaryPresentedItemURL"
}
-->

# primaryPresentedItemURL

The URL of a secondary item’s primary presented file or directory.

```
optional var primaryPresentedItemURL: URL? { get }
```

## Discussion

This property supports App Sandbox in macOS.

Some apps require access to secondary files or directories with names that are related to the primary, user-selected file. For example, a subtitle file, by convention, has the same name as its corresponding movie file, but with a different filename extension. If a movie player is sandboxed, an <doc://com.apple.documentation/documentation/AppKit/NSOpenPanel> object will grant access only to the user-selected movie file (the primary item) and not its associated subtitle file (the secondary item).

To gain access to a secondary item, first register an [`NSFilePresenter`](/documentation/Foundation/NSFilePresenter) object for it. At any point in its existence, a secondary item must be able to return an [`NSURL`](/documentation/Foundation/NSURL) object to its primary item. This is done by using this property.  When done accessing the secondary item, unregister the file presenter object.

---

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)