问题
In Cocoa on Mac, I would like to add a menu item in the Finder's popup menu that comes when I right-click on a file or a folder, and having this item pointing to a function in my app.
How can I achieve this ?
Thanks !
回答1:
A good place to start is CocoaDev: StandardService. It outlines what you are trying to accomplish and they give some source code to follow such as the MakingServices example.
2015 Update: As of Yosemite, Apple includes an extension called Finder Sync which allows you to accomplish most of what a Service used to do.
Best of luck.
来源:https://stackoverflow.com/questions/9420361/add-an-item-in-finders-contextual-menu-with-cocoa