How to disable Finder "Move to Bin" action for non materialised files

In the context of a NSFileProviderReplicatedExtension I would like to only see the "Move to Bin" Finder action when files have been materlialised ( isDownloaded fileprovider attribute )

I thought it might be possible to get the isDownloaded attribute in my NSFileProviderItemProtocol class capabilities method but that doesn't seem to be the case.

Possible ?

If you set -[NSFileProviderDomain supportsSyncingTrash] to NO, then Finder should require immediate deletion of non-downloaded items. The Move to Trash contextual menu may still appear, but once clicked, it will tell the user that they must delete these files immediately, and ask if they wish to proceed.

Another solution, you could use the UserInteraction system to present an alert to the user when they try to delete a non-downloaded file, and configure the alert to not allow the user to continue. The predicate property you want to check is isRecursivelyDownloaded. See the FruitBasket sample code for how to setup such an alert. Many of the alerts in FruitBasket have such a setup (not allowing the user to continue), search the Provider/Info.plist for “Cannot” to find those.

How to disable Finder "Move to Bin" action for non materialised files
 
 
Q