---
title: targetedURL()
framework: Finder Sync
role: symbol
role_heading: Instance Method
platforms: [macOS 10.10+]
path: findersync/fifindersynccontroller/targetedurl()
---

# targetedURL()

Returns the URL of the Finder’s current target.

## Declaration

```swift
func targetedURL() -> URL?
```

## Return Value

Return Value The URL of the Finder’s current target.

## Discussion

Discussion Use this method when creating a custom shortcut menu for the Finder. This returns the URL of the item that the user Control-clicked, letting you customize the menu for that item. This method returns valid values only from the Finder Sync extension’s menu(for:) method or from one of the menu actions created in this method. If the selected items are outside the extension’s managed directories (for example, when the user clicks on the toolbar button), this method returns nil.

## See Also

### Managing the Finder Sync Controller

- [default()](findersync/fifindersynccontroller/default().md)
- [directoryURLs](findersync/fifindersynccontroller/directoryurls.md)
- [selectedItemURLs()](findersync/fifindersynccontroller/selecteditemurls().md)
- [setBadgeIdentifier(_:for:)](findersync/fifindersynccontroller/setbadgeidentifier(_:for:).md)
- [setBadgeImage(_:label:forBadgeIdentifier:)](findersync/fifindersynccontroller/setbadgeimage(_:label:forbadgeidentifier:).md)
