I need to add a context-sensitive menu to file icons in the finder. So basically if I right click, say, the "filename.txt" icon, a submenu should pop up with "Open", "Get Info", etc but there should be an additional item that says, say, "My Program". And if user selects the "My Program" menu selection, the system will execute: "my_program.rb filename.txt".
I have Mac OS 10.6 32-bit.
I checked stack overflow and I there are posted solutions, but am a bit confused by them. Firstly, according to this stack overflow article, you have to "add a Service that enables the share facility", but this is confusing to me. What is a "service"? Is that a program with special hooks to the OS or something?
There is also an apple article for "providing a service" but again, I am a bit confused by it. Can a ruby script count as a "service"? Or do I have to do some weird Cocoa thing in objective C to access the submenu and then refer to the script in there?
Is there a simpler way to do this? Maybe an open source program that I haven't yet encountered?
You should use services.Take a look at Services Implementation Guide and MakingServices.
Services are features exported by your application for the benefit of other applications. Services let you share the resources and capabilities of your application with other applications in the system.
Services are are accessible from contextual menu.