Custom display name in Finder Favorites for NSFileProviderDomain — keeping the FP extension icon

How does an app bind a custom display name to a sidebar Favorites entry pointing at a NSFileProviderDomain mount, while preserving the FP extension's icon?

Inserting the volume URL directly via LSSharedFileListInsertItemURL keeps the icon but uses the volume's default name. Inserting an alias-bookmark file or symlink to the volume with a custom filename gives the custom name but drops the icon to the generic alias glyph.

Since other apps seem to have achieved this, I wonder what's missing in order to get it working. I've dropped a lot of work into this already and tried so many things but none has been working.

What's complicating things is that working with plugins are easy to get wrong – the old plugin might not be correctly unloaded so you get stale behaviour etc. I've already spent more time with this than I'd care to admit.

Since LSSharedFileListInsertItemURL is deprecated it's natural that setting the name/icon is getting ignored, but there's clearly a way to make it work.

For apps that have this working I did the following test:

  1. Change the name - icon stays the same
  2. Restart Finder - icon now becomes a generic icon
  3. Change the name back to the original
  4. Restart Finder - icon reverts to the "proper" icon.

Apart from this I've been able to verify that aliases produced by my app has the same data as apps with this working.

Any hints would be greatly appreciated.

Answered by DTS Engineer in 886432022

How does an app bind a custom display name to a sidebar Favorites entry pointing at a NSFileProviderDomain mount, while preserving the FP extension's icon?

It's possible I've misunderstood what you're asking here, but the typical way File Provider extensions set their sidebar icon is described in the FileProvider document "Setting the Finder Sidebar Icon".

Is that what you're trying to do?

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

How does an app bind a custom display name to a sidebar Favorites entry pointing at a NSFileProviderDomain mount, while preserving the FP extension's icon?

It's possible I've misunderstood what you're asking here, but the typical way File Provider extensions set their sidebar icon is described in the FileProvider document "Setting the Finder Sidebar Icon".

Is that what you're trying to do?

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

I would like to bring to your attention the following related issues with customizing the display name for file provider domains in the Finder sidebar.

  • FB13669451. The displayName property of NSFileProviderDomain is not honoured with a single domain but instead the application name is set for the domain alias in the „Locations“ section of the Finder sidebar. When an application connects two domains, the display name is set but only as a suffix of the application name. We want to have full control over the name of the item in the sidebar.
  • FB13397980. Unable to register domains with same display name but different identifier
  • FB19406902. Allow to modify the display name of an existing NSFileProviderDomain.
Custom display name in Finder Favorites for NSFileProviderDomain — keeping the FP extension icon
 
 
Q