views:

2794

answers:

6

I'm looking for a guide or sample code for writing Mac OS X Finder plugins? It would like to know how to do some simple actions:

  1. adding image overlayers to icons
  2. adding context menu items
  3. listen to file changes

I found the following two resources:

I am tempted to review the SCPlugin code, but was hoping to find an easier sample to digest.

+1  A: 

The pickings are slim; it's never been really clear to me whether Finder Plugins are actually supported. A few more leads, though:

  • SampleCMPlugIn - Carbon-based of course, since so is Finder. Note that almost any Finder plugin is probably going to stop working with 10.6.
  • Automator can save things as a "Finder plugin." It's a more supported version of what you're discussing, but of course less flexible.
Rob Napier
+6  A: 
Benjamin Pollack
thanks for the explanation. I will just wait for the Snow Leopard public release.
notnoop
+1  A: 

As far as I know, there's no official plugin architecture for the Finder. You may be able to add image overlays to icons through an external application without having to hook into the Finder, although it wouldn't be on the fly. I don't think there is a way to add contextual menu items aside from Folder Actions and Automator. You can also look into writing an external application to monitor File System changes using the FSEvents API.

Martin Gordon
A: 

More than a year later I would like to bring this back to 'life'... I am looking into writing some plugins to 'Finder' on Snow Leopard but cannot seem to find a good tutorial or simple example. Any idea where can I find it?

ask a new question.
Dave DeLong
A: 

Dropbox is doing it, and doing it well. How? That's what I'd like to know...

datico
This should be a comment, rather than an answer!
notnoop
+2  A: 

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.

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.

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

anthony