2

I implemented copy and pasting using NSPasteboard and FilePromise within my app. Now I'd like to implement the following workflow.

  1. Copy an item in my app.
let provider = NSFilePromiseProvider(fileType: kUTTypeVideo as String, delegate: self)
  1. Open Finder
  2. Paste the item to Finder using the mouse context menu.

I'm stuck at the step 3. Finder doesn't recognize the items I added to the pasteboard so there's no "Paste Item' menu in the context menu.

Please note that this is not a drag-and-drop. With drag-and-drop, the following delegate is called just fine.

func filePromiseProvider(_ filePromiseProvider: NSFilePromiseProvider, writePromiseTo url: URL, completionHandler: @escaping (Error?) -> Void) {

Could someone give me a pointer?

TylerP
  • 9,600
  • 4
  • 39
  • 43
lishrimp
  • 176
  • 1
  • 4
  • Does this answer your question? [How to use NSPasteboard with kPasteboardTypeFileURLPromise for copy/paste?](https://stackoverflow.com/questions/58886232/how-to-use-nspasteboard-with-kpasteboardtypefileurlpromise-for-copy-paste) – Willeke Sep 11 '20 at 08:57
  • Did you ever figure this out? I have the same problem and the above mentioned reference doesn't have a solution either. – B. Leslie Jun 16 '21 at 20:03

0 Answers0