在Finder的与Cocoa相关的上下文菜单中添加一个项目 [英] Add an item in Finder's contextual menu with Cocoa
问题描述
在Mac上的Cocoa中,我想在Finder的弹出菜单中添加一个菜单项,当我右键单击文件或文件夹,并使此项指向我的应用程序中的某个函数时。
如何实现?
谢谢!
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 !
推荐答案
开始的好地方是 CocoaDev:StandardService 。它概述了您要完成的内容,并提供了一些源代码,例如制作服务示例。
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更新:自Yosemite起,Apple包含一个名为 Finder Sync ,可让您完成大部分的服务。
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.
最好的运气。
这篇关于在Finder的与Cocoa相关的上下文菜单中添加一个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!