Add an item in Finder's contextual menu with Cocoa

心不动则不痛 提交于 2020-01-05 08:46:23

问题



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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!