如何将项目添加到 Mac OS X 中的 Finder 上下文菜单?

发布于 2024-09-04 09:28:45 字数 236 浏览 1 评论 0原文

我正在将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

束缚m 2024-09-11 09:28:45

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.

清眉祭 2024-09-11 09:28:45

每个库文件夹中可能有一个“上下文菜单项”文件夹。放置在该文件夹中的特殊插件包将被加载,并且可能会将项目放置在上下文菜单中。在 Menus.h 中查找这些插件包的入口点。

CMPluginExamineContext
CMPluginHandleSelection
CMPluginPostMenuCleanup

据我所知,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.

CMPluginExamineContext
CMPluginHandleSelection
CMPluginPostMenuCleanup

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文