如何将项目添加到 Mac OS X 中的 Finder 上下文菜单?
我正在将 Windows 应用程序移植到 OS X(我们用 Java 编写,因此大部分代码都是可移植的),但我目前不确定的是,当用户右键单击一个项目(即我希望将一些项目添加到具有“打开”、“打开方式”、“获取信息”等的菜单中...当用户右键单击时)。
我发现的大多数文章专门涉及 Windows(我搜索了“上下文菜单”和“shell 扩展”,但我相信我可能搜索了错误的术语),所以我很好奇如何去关于在 Mac 中添加这个或我应该阅读哪些文献。
I'm in the process of porting a Windows application to OS X (we wrote it in Java so most of the code is portable), but what I'm currently unsure of is how to add context menu items in the Finder window when the user right clicks on an item (i.e. I wish to add some items to the the menu that has "Open" "Open with" , "Get Info", etc... when the user right clicks).
Most of the articles I've found deal specifically with Windows (I've searched for "context menus" and "shell extension", but I believe I may be searching the wrong terms), so I'm curious as to how to go about adding this in Mac or what literature I should be reading.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能想看看如何使用服务。 Finder 将适用的服务附加到其上下文菜单的末尾,并根据您的需求,满足您的需求。
You may want to take a look at using Services. The Finder appends applicable Services to the end of its contextual menu and, depending on your needs, just fit the bill.
每个库文件夹中可能有一个“上下文菜单项”文件夹。放置在该文件夹中的特殊插件包将被加载,并且可能会将项目放置在上下文菜单中。在
Menus.h
中查找这些插件包的入口点。据我所知,64 位应用程序不支持上下文菜单项。从 10.6 开始,大多数 Apple 应用程序(包括 Finder)都以 64 位运行(如果可用)。
如果您必须使用第三方应用程序,可以在 10.6 上恢复上下文菜单项。
In each Library folder may be a "Contextual Menu Items" folder. Special plugin bundles placed in that folder will be loaded and may place items in contextual menus. Look in
Menus.h
for the entry points of these plugin bundles.From what I have read, Contextual Menu Items are not supported for 64 bit applications. As of 10.6 most Apple applications, including the Finder, run in 64 bit when available.
There are third party applications that restore contextual menu items on 10.6 if you must have them.