如何在Snow Leopard中编写Finder插件

时间:2023-01-14 13:56:26

Everywhere I look I see that writing a Finder Plugin in Snow Leopard is much easier than it was in Leopard. Can someone point me to some tutorial or simple code example I can download?

无论我到哪里,我都看到在Snow Leopard中编写Finder插件比在Leopard中更容易。有人能指出我可以下载的一些教程或简单的代码示例吗?

I am trying to write a customer right-click menu item for Finder.

我正在尝试为Finder编写客户右键单击菜单项。

5 个解决方案

#1


4  

There is no official or supported plugin system for the Finder. Starting with OS X 10.6, you will need to inject code into the Finder process and override objective C methods in the Finder process.

Finder没有官方或支持的插件系统。从OS X 10.6开始,您需要将代码注入Finder流程并在Finder流程中覆盖目标C方法。

I've done this for a proprietary project. I can tell you that the reason that there are no examples or tutorials for this is because it is a significantly difficult and time consuming development task. For this reason, there's plenty of incentive for individuals or organizations who have accomplished this to guard the specifics of their process closely.

我已经为一个专有项目做了这个。我可以告诉你,没有示例或教程的原因是因为这是一项非常困难且耗时的开发任务。出于这个原因,对于完成此任务的个人或组织来说,有足够的动力来密切关注他们的过程细节。

If there's any way at all that you can accomplish your goal using the Services API, do it. Writing a Finder plugin will take you 1-2 solid months of painstaking development and reasonably deep knowledge of C and Objective-C internals.

如果有任何方法可以使用Services API完成目标,那就去做吧。编写Finder插件将需要1-2个月的艰苦发展和对C和Objective-C内部的相当深入的了解。

If you're still convinced that you want do to this, grab mach_star. Good luck.

如果你仍然相信你想做到这一点,抓住mach_star。祝你好运。

#2


2  

If by plug-in you mean contextual menu, you can do this via the services API.

如果插件是指上下文菜单,则可以通过服务API执行此操作。

Hope this helps.

希望这可以帮助。

PK

PK

#3


0  

Apple now requires that you write a Service instead of a Finder plug-in. That's why you're finding it so much more difficult now than before. In fact, context menu plug-in support has been removed from 64-bit applications (which the Finder is now by default). Even if the context menu plug-in is 64-bit, the application will not load it. However, enhanced services show up as context menu items, so this should allow you to implement the same feature set that you're looking for.

Apple现在要求您编写服务而不是Finder插件。这就是为什么你现在发现它比现在困难得多。实际上,已从64位应用程序(默认情况下为Finder)中删除了上下文菜单插件支持。即使上下文菜单插件是64位,应用程序也不会加载它。但是,增强型服务显示为上下文菜单项,因此这应该允许您实现您正在寻找的相同功能集。

See the answers to this question for more on how to write Services in Snow Leopard.

有关如何在Snow Leopard中编写服务的更多信息,请参阅此问题的答案。

#4


0  

Dropbox and Safesync have a Finder plugin for displaying contextual menues and overlay icons. I am not sure how Dropbox did, but for Safesync, you can find a bundle located in /Library/Application Support/SIMBL/Plugins. So SIMBL may helps.

Dropbox和Safesync有一个Finder插件,用于显示上下文菜单和叠加图标。我不确定Dropbox是怎么做的,但是对于Safesync,你可以在/ Library / Application Support / SIMBL / Plugins中找到一个包。所以SIMBL可能有所帮助。

#5


0  

This question has been around for awhile, but I know people are still looking so here's a completed solution for Finder icon badges and contextual menus in Lion and Mountain Lion using method swizzling.

这个问题已经存在了一段时间,但我知道人们仍然在寻找这样一个完整的解决方案,用于使用方法调配的Lion和Mountain Lion中的Finder图标徽章和上下文菜单。

Liferay Nativity provides a scripting bundle that will swizzle the relevant Finder methods and a Java client for setting the icons and context menus. It also includes equivalent projects for Windows and Linux.

Liferay Nativity提供了一个脚本捆绑包,它将调整相关的Finder方法和一个用于设置图标和上下文菜单的Java客户端。它还包括Windows和Linux的等效项目。

Hopefully this will save you the 1-2 solid months of painstaking development described by anthony. :)

希望这将为你节省安东尼描述的1-2个坚实的艰苦发展。 :)

The project is open source under LGPL, so feel free to contribute any bug fixes or improvements!

该项目是LGPL下的开源项目,因此请随时提供任何错误修复或改进!

#1


4  

There is no official or supported plugin system for the Finder. Starting with OS X 10.6, you will need to inject code into the Finder process and override objective C methods in the Finder process.

Finder没有官方或支持的插件系统。从OS X 10.6开始,您需要将代码注入Finder流程并在Finder流程中覆盖目标C方法。

I've done this for a proprietary project. I can tell you that the reason that there are no examples or tutorials for this is because it is a significantly difficult and time consuming development task. For this reason, there's plenty of incentive for individuals or organizations who have accomplished this to guard the specifics of their process closely.

我已经为一个专有项目做了这个。我可以告诉你,没有示例或教程的原因是因为这是一项非常困难且耗时的开发任务。出于这个原因,对于完成此任务的个人或组织来说,有足够的动力来密切关注他们的过程细节。

If there's any way at all that you can accomplish your goal using the Services API, do it. Writing a Finder plugin will take you 1-2 solid months of painstaking development and reasonably deep knowledge of C and Objective-C internals.

如果有任何方法可以使用Services API完成目标,那就去做吧。编写Finder插件将需要1-2个月的艰苦发展和对C和Objective-C内部的相当深入的了解。

If you're still convinced that you want do to this, grab mach_star. Good luck.

如果你仍然相信你想做到这一点,抓住mach_star。祝你好运。

#2


2  

If by plug-in you mean contextual menu, you can do this via the services API.

如果插件是指上下文菜单,则可以通过服务API执行此操作。

Hope this helps.

希望这可以帮助。

PK

PK

#3


0  

Apple now requires that you write a Service instead of a Finder plug-in. That's why you're finding it so much more difficult now than before. In fact, context menu plug-in support has been removed from 64-bit applications (which the Finder is now by default). Even if the context menu plug-in is 64-bit, the application will not load it. However, enhanced services show up as context menu items, so this should allow you to implement the same feature set that you're looking for.

Apple现在要求您编写服务而不是Finder插件。这就是为什么你现在发现它比现在困难得多。实际上,已从64位应用程序(默认情况下为Finder)中删除了上下文菜单插件支持。即使上下文菜单插件是64位,应用程序也不会加载它。但是,增强型服务显示为上下文菜单项,因此这应该允许您实现您正在寻找的相同功能集。

See the answers to this question for more on how to write Services in Snow Leopard.

有关如何在Snow Leopard中编写服务的更多信息,请参阅此问题的答案。

#4


0  

Dropbox and Safesync have a Finder plugin for displaying contextual menues and overlay icons. I am not sure how Dropbox did, but for Safesync, you can find a bundle located in /Library/Application Support/SIMBL/Plugins. So SIMBL may helps.

Dropbox和Safesync有一个Finder插件,用于显示上下文菜单和叠加图标。我不确定Dropbox是怎么做的,但是对于Safesync,你可以在/ Library / Application Support / SIMBL / Plugins中找到一个包。所以SIMBL可能有所帮助。

#5


0  

This question has been around for awhile, but I know people are still looking so here's a completed solution for Finder icon badges and contextual menus in Lion and Mountain Lion using method swizzling.

这个问题已经存在了一段时间,但我知道人们仍然在寻找这样一个完整的解决方案,用于使用方法调配的Lion和Mountain Lion中的Finder图标徽章和上下文菜单。

Liferay Nativity provides a scripting bundle that will swizzle the relevant Finder methods and a Java client for setting the icons and context menus. It also includes equivalent projects for Windows and Linux.

Liferay Nativity提供了一个脚本捆绑包,它将调整相关的Finder方法和一个用于设置图标和上下文菜单的Java客户端。它还包括Windows和Linux的等效项目。

Hopefully this will save you the 1-2 solid months of painstaking development described by anthony. :)

希望这将为你节省安东尼描述的1-2个坚实的艰苦发展。 :)

The project is open source under LGPL, so feel free to contribute any bug fixes or improvements!

该项目是LGPL下的开源项目,因此请随时提供任何错误修复或改进!