R – Contextual Menu Item development for OSX (Leopard and Snow Leopard)

applescriptcocoamacososx-leopardosx-snow-leopard

i was wondering what the best practice is for creating a contextual menu item that would work in both leopard and snow leopard and works with a selection of files and/or folders, sending them to a shellscript.

i know that the contextual menu items have been deprecated in SL – but does that mean there is no way to create a solution that would work on both Leopard and Snow Leopard (using applescript or xcode or automator)?

basically i want to feed the files/folders to a shellscript that creates different compressed archives (rar, zip, tbz2) out of them.

thanks for your help!

Best Answer

There's not really a way to create one overall piece of code that will work in both Leopard and Snow Leopard.

You can, however, create a service for Snow Leopard and then create a Finder contextual menu for Leopard that just invokes that service.

That way you can do most of your implementation in Cocoa as part of the service, and only use the Finder contextual menu portion on systems that can't "natively" use the service.

Related Topic