
However, since none of the links I trawled included both up-to-date and complete examples, I figured I’d put one together for whoever has to fight this battle in the future. Caveat emptor, but really, it’s as simple as hell, so you can’t go wrong.
DockDrop.zip, 19KB, version 1.0 - GitHub
If you’re interested, the nitty gritty magic bits that need be plumbed up just right:
- Make sure your delegate implements
NSApplicationDelegate, and that it is set as the delegate ofNSApp. - Implement
application:openFile:in said delegate. - Ensure you have a proper
CFBundleDocumentTypesentry in your app’s Info.plist (see the example’s plist).