Search code examples
cocoacontextmenufinder

How do you show the Finder context menu from a Cocoa application?


I have a file listing in my application and I would like to allow people to right-click on an item and show the same contextual menu as Finder does. Is this possible?

The same functionallity but for Windows Explorer is discussed in How do you show the Windows Explorer context menu from a C# application?.


Solution

  • You can't extract the Finder's contextual menu in any stable way, no. Neither can you tell the Finder “show your contextual menu here, as if the user had right-clicked on this item”.

    You'll have to make your own.